Skip to content

Commit

Permalink
Use Trusted publishing for PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
dofuuz committed Aug 19, 2024
1 parent 23f92ec commit 81c4f29
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'

environment:
name: pypi
url: https://pypi.org/p/soxr
permissions:
contents: write
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -99,16 +107,11 @@ jobs:
merge-multiple: true

- uses: softprops/action-gh-release@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
files: |
dist/*.tar.gz
dist/*.whl
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# To test
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# with:
# repository_url: https://test.pypi.org/legacy/ # To test

0 comments on commit 81c4f29

Please sign in to comment.