From edafd92986bf236ad663ec9263fc862e81dce73a Mon Sep 17 00:00:00 2001 From: David Brochart Date: Fri, 8 Nov 2024 09:39:08 +0100 Subject: [PATCH] Add PyPI trusted publishing (#2) --- .github/workflows/publish.yml | 18 ++++++++---------- .github/workflows/test.yml | 3 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ae02161..279e248 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,16 +21,14 @@ jobs: path: ./dist pypi-publish: - needs: ['build'] - environment: 'publish' - name: Upload release to PyPI + needs: build runs-on: ubuntu-latest + environment: release + permissions: + id-token: write steps: - - uses: actions/download-artifact@v4 - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_TOKEN }} - packages_dir: artifact/ + - name: Retrieve packages + uses: actions/download-artifact@v4 + - name: Upload packages + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33902b4..66ec1cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,9 +28,10 @@ jobs: - name: Check types run: mypy src/zmq_anyio - name: Run tests + if: ${{ !((matrix.python-version == '3.13') && (matrix.os == 'ubuntu-latest')) }} run: pytest --color=yes -v tests - name: Run code coverage if: ${{ (matrix.python-version == '3.13') && (matrix.os == 'ubuntu-latest') }} run: | - coverage run -m pytest tests + coverage run -m pytest --color=yes -v tests coverage report