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