Skip to content

Commit 3db225b

Browse files
committed
GHA: Add PyPI publish job to release workflow
1 parent ca36457 commit 3db225b

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ permissions:
44
contents: read
55

66
on:
7+
release:
8+
types:
9+
- published
710
workflow_dispatch:
811

912
jobs:
@@ -36,10 +39,34 @@ jobs:
3639
- name: Check binary distribution
3740
run: python -m twine check dist/pyspod-*.whl
3841

39-
- name: Upload source distributionx
42+
- name: Upload distribution assets
4043
uses: actions/upload-artifact@v3
4144
with:
4245
name: release
4346
path: |
4447
dist/*.tar.gz
4548
dist/*.whl
49+
50+
51+
pypi-publish:
52+
53+
if: ${{ github.event_name == 'release' }}
54+
name: Upload release to PyPI
55+
runs-on: ubuntu-latest
56+
needs: distribution
57+
environment:
58+
name: pypi
59+
url: https://pypi.org/p/pyspod
60+
permissions:
61+
id-token: write
62+
63+
steps:
64+
65+
- name: Download distribution assets
66+
uses: actions/download-artifact@v3
67+
with:
68+
name: release
69+
path: dist
70+
71+
- name: Publish package distributions to PyPI
72+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)