Skip to content

Commit a3f4a8c

Browse files
authored
Update python-publish.yml
1 parent bac1fb5 commit a3f4a8c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Diff for: .github/workflows/python-publish.yml

+42
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,45 @@ jobs:
7070
uses: pypa/gh-action-pypi-publish@release/v1
7171
with:
7272
packages-dir: dist/
73+
github-release:
74+
name: >-
75+
Sign the Python 🐍 distribution 📦 with Sigstore
76+
and upload them to GitHub Release
77+
needs:
78+
- pypi-publish
79+
runs-on: ubuntu-latest
80+
81+
permissions:
82+
contents: write # IMPORTANT: mandatory for making GitHub Releases
83+
id-token: write # IMPORTANT: mandatory for sigstore
84+
85+
steps:
86+
- name: Download all the dists
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: python-package-distributions
90+
path: dist/
91+
- name: Sign the dists with Sigstore
92+
uses: sigstore/[email protected]
93+
with:
94+
inputs: >-
95+
./dist/*.tar.gz
96+
./dist/*.whl
97+
- name: Create GitHub Release
98+
env:
99+
GITHUB_TOKEN: ${{ github.token }}
100+
run: >-
101+
gh release create
102+
"$GITHUB_REF_NAME"
103+
--repo "$GITHUB_REPOSITORY"
104+
--notes ""
105+
- name: Upload artifact signatures to GitHub Release
106+
env:
107+
GITHUB_TOKEN: ${{ github.token }}
108+
# Upload to GitHub Release using the `gh` CLI.
109+
# `dist/` contains the built packages, and the
110+
# sigstore-produced signatures and certificates.
111+
run: >-
112+
gh release upload
113+
"$GITHUB_REF_NAME" dist/**
114+
--repo "$GITHUB_REPOSITORY"

0 commit comments

Comments
 (0)