Skip to content

Commit

Permalink
publish to pypi on github release instead of tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Sep 13, 2024
1 parent 7087f31 commit 30b86e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
push:
branches:
- main
release:
types:
- published

jobs:
build_wheels:
Expand Down Expand Up @@ -46,7 +49,9 @@ jobs:
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
Expand Down

0 comments on commit 30b86e6

Please sign in to comment.