File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish release to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+ tags :
6+ - ' *'
7+ release :
8+ types : [published]
9+
10+ # ##############################################################################
11+ # ⬇️ Default permissions for the whole workflow: pull code + request OIDC
12+ # ##############################################################################
13+ permissions :
14+ contents : read # required by gh release download
15+ id-token : write # 🔑 enables token-less “Trusted Publisher” uploads
16+
17+ jobs :
18+ publish-to-pypi :
19+ if : |
20+ (github.event_name == 'release' && github.event.release.prerelease == false) ||
21+ (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/'))
22+ runs-on : ubuntu-latest
23+ environment : pypi
24+
25+ steps :
26+ - uses : actions/checkout@v3
27+ - name : Download release assets
28+ env :
29+ GH_TOKEN : ${{ github.token }}
30+ run : |
31+ gh release download \
32+ "${{ github.event.release.tag_name }}" \
33+ --repo "${{ github.repository }}" \
34+ --dir dist
35+
36+ - name : Publish to PyPI
37+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments