Skip to content

Commit

Permalink
Add PyPI trusted publishing (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Nov 8, 2024
1 parent 27ec8dc commit edafd92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit edafd92

Please sign in to comment.