Skip to content

Commit

Permalink
GHA: Add PyPI publish job to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Sep 21, 2023
1 parent ca36457 commit 3db225b
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ permissions:
contents: read

on:
release:
types:
- published
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -36,10 +39,34 @@ jobs:
- name: Check binary distribution
run: python -m twine check dist/pyspod-*.whl

- name: Upload source distributionx
- name: Upload distribution assets
uses: actions/upload-artifact@v3
with:
name: release
path: |
dist/*.tar.gz
dist/*.whl
pypi-publish:

if: ${{ github.event_name == 'release' }}
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: distribution
environment:
name: pypi
url: https://pypi.org/p/pyspod
permissions:
id-token: write

steps:

- name: Download distribution assets
uses: actions/download-artifact@v3
with:
name: release
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 3db225b

Please sign in to comment.