Skip to content

Commit 4322641

Browse files
authored
Merge pull request #10 from grafana/create-github-releases
ci: also create GitHub releases with signed builds
2 parents a54f8b6 + e79deb0 commit 4322641

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,46 @@ jobs:
5858
version: "0.5.13"
5959
- name: Publish distribution 📦 to PyPI
6060
run: uv publish
61+
62+
github-release:
63+
name: >-
64+
Sign the Python 🐍 distribution 📦 with Sigstore
65+
and upload them to GitHub Release
66+
needs:
67+
- publish-to-pypi
68+
runs-on: ubuntu-latest
69+
70+
permissions:
71+
contents: write # IMPORTANT: mandatory for making GitHub Releases
72+
id-token: write # IMPORTANT: mandatory for sigstore
73+
74+
steps:
75+
- name: Download all the dists
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: python-package-distributions
79+
path: dist/
80+
- name: Sign the dists with Sigstore
81+
uses: sigstore/[email protected]
82+
with:
83+
inputs: >-
84+
./dist/*.tar.gz
85+
./dist/*.whl
86+
- name: Create GitHub Release
87+
env:
88+
GITHUB_TOKEN: ${{ github.token }}
89+
run: >-
90+
gh release create
91+
"$GITHUB_REF_NAME"
92+
--repo "$GITHUB_REPOSITORY"
93+
--notes ""
94+
- name: Upload artifact signatures to GitHub Release
95+
env:
96+
GITHUB_TOKEN: ${{ github.token }}
97+
# Upload to GitHub Release using the `gh` CLI.
98+
# `dist/` contains the built packages, and the
99+
# sigstore-produced signatures and certificates.
100+
run: >-
101+
gh release upload
102+
"$GITHUB_REF_NAME" dist/**
103+
--repo "$GITHUB_REPOSITORY"

0 commit comments

Comments
 (0)