From dd89e4b32e5e17d1a4942c8c75a10a520c86581a Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 16 Apr 2024 15:18:53 -0400 Subject: [PATCH] Publish Python builds using OIDC --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 18 ++++++++---------- tox.ini | 14 -------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9dcdae0..6b24b1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,9 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install tox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15ff7c4..008830c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,22 +6,20 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Tags are needed to compute the current version number fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" - - name: Install tox + - name: Install Python build run: | pip install --upgrade pip - pip install tox - - name: Publish to PyPI - env: - TWINE_USERNAME: "__token__" - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - TWINE_NON_INTERACTIVE: "true" + pip install build + - name: Build the Python distribution run: | - tox -e release + python -m build + - name: Publish the Python distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/tox.ini b/tox.ini index 1e5c477..1276402 100644 --- a/tox.ini +++ b/tox.ini @@ -43,20 +43,6 @@ deps = commands = mypy {posargs} -[testenv:release] -package = skip -passenv = - TWINE_USERNAME - TWINE_PASSWORD - TWINE_NON_INTERACTIVE -deps = - build - twine -commands = - pyproject-build --sdist --wheel --outdir {envtmpdir} - twine check {envtmpdir}/* - twine upload --skip-existing {envtmpdir}/* - [flake8] max-line-length = 100 show-source = True