Skip to content

Commit

Permalink
Only upload to PyPI when pusing a version tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gmloose committed Sep 5, 2024
1 parent c58b2cd commit 192dfd9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,21 @@ jobs:
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
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'
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
# Upload to PyPI on every tag starting with 'v'
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'
steps:
- uses: actions/download-artifact@v4
with:
# unpack artifacts in `dist` where the next action expects them to be
path: dist
# pattern: dist/*
merge-multiple: true
- run: ls -lR

- uses: pypa/[email protected]
with:
skip-existing: true
verbose: true
# user: __token__
# password: ${{ secrets.pypi_password }}
# To test:
repository-url: https://test.pypi.org/legacy/

0 comments on commit 192dfd9

Please sign in to comment.