Skip to content

Commit 7b692ce

Browse files
blink1073lwasser
authored andcommitted
Sign pypi releases using sigstore
1 parent 69e583f commit 7b692ce

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,38 @@ jobs:
7070
# Only publish to real PyPI on release
7171
if: github.event_name == 'release'
7272
uses: pypa/gh-action-pypi-publish@release/v1
73+
sign-files:
74+
name: >-
75+
Sign the Python 🐍 distribution 📦 with Sigstore
76+
and upload them to GitHub Release
77+
if: github.repository_owner == 'pyopensci'
78+
needs:
79+
- publish
80+
runs-on: ubuntu-latest
81+
permissions:
82+
contents: write # this permission is mandatory for modifying GitHub Releases
83+
id-token: write # this permission is mandatory for sigstore
84+
steps:
85+
- name: Download all the dists
86+
uses: actions/download-artifact@v3
87+
with:
88+
name: python-package-distributions
89+
path: dist/
90+
- name: Sign the dists with Sigstore
91+
uses: sigstore/[email protected]
92+
with:
93+
inputs: >-
94+
./dist/*.tar.gz
95+
./dist/*.whl
96+
- name: Upload artifact signatures to GitHub Release
97+
# Only upload on release
98+
if: github.event_name == 'release'
99+
env:
100+
GITHUB_TOKEN: ${{ github.token }}
101+
# Upload to GitHub Release using the `gh` CLI.
102+
# `dist/` contains the built packages, and the
103+
# sigstore-produced signatures and certificates.
104+
run: >-
105+
gh release upload
106+
'${{ github.ref_name }}' dist/**
107+
--repo '${{ github.repository }}'

0 commit comments

Comments
 (0)