Skip to content

Commit

Permalink
Update so that dev branch pushes end up with an upload to pypi testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Finnie committed Aug 5, 2024
1 parent e200345 commit 9db03c7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/distribute_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,32 @@ jobs:
path: dist/*.tar.gz

upload_pypi:
name: Upload release to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
environment:
name: pypi
permissions:
id-token: write
# Upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

# This is the live push to PyPI on tagging the master branch
- uses: pypa/gh-action-pypi-publish@release/v1
# Upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
repository-url: https://pypi.org/p/pygom

# Upload to PyPI *testing* every dev branch commit
- uses: pypa/gh-action-pypi-publish@release/v1
# Upload to testing only if we are on the dev branch
if: github.ref == 'refs/heads/dev'
with:
# Testing only at this point
repository-url: https://test.pypi.org/legacy/

0 comments on commit 9db03c7

Please sign in to comment.