Skip to content

Commit cd1c53a

Browse files
committed
Add publish pypi action
1 parent b458378 commit cd1c53a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish release to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
###############################################################################
8+
# ⬇️ Default permissions for the whole workflow: pull code + request OIDC
9+
###############################################################################
10+
permissions:
11+
contents: read # required by gh release download
12+
id-token: write # 🔑 enables token-less “Trusted Publisher” uploads
13+
14+
jobs:
15+
publish-to-pypi:
16+
if: ${{ github.event.release.prerelease == false }} # skip prereleases
17+
runs-on: ubuntu-latest
18+
environment: pypi
19+
20+
steps:
21+
- name: Download release assets
22+
env:
23+
GH_TOKEN: ${{ github.token }} # granted automatically
24+
run: gh release download "${{ github.event.release.tag_name }}" --dir dist
25+
26+
- name: Publish to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)