Skip to content

Commit

Permalink
Update workflow for PyPI deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed May 6, 2024
1 parent 5c233b7 commit 67f3142
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/github-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@ jobs:
run: pipx run twine check dist/*


publish:
needs: [dist]
runs-on: ubuntu-latest
publish-to-pypi:
name: >-
Publish to PyPI
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.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'

needs:
- dist
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sourcespec
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: claudiodsf
password: ${{ secrets.pypi_password }}
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 67f3142

Please sign in to comment.