Repository navigation
ci(release): sign the sdist and wheel with Sigstore and attach SLSA build provenance - #415
Conversation
…uild provenance The attach job now creates a build-provenance attestation for both files (actions/attest-build-provenance, also stored in the repository attestations) and signs each with sigstore-python (keyless, the workflow's OIDC identity), then uploads <file>.sigstore.json and dokimi-X.Y.Z.intoto.jsonl next to them. docs/releasing.md shows how to verify a download. OpenSSF Scorecard's Signed-Releases check looks for exactly these assets. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…gning Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
🔍 OpenCodeReview found 1 issue(s) in this PR. CI at By severity: 1 medium
Review details
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
dist/*is very broad and will start including additional files as the workflow evolves (e.g., if… · New The verification commands hardcodeintel/dokimi, which makes the documentation less reusable for… · New The phrase “also ingh attestation verify” is ambiguous (the command isn’t a location). Consider… · New
What changed in this PR
Adds Sigstore signing and SLSA build provenance publishing to the GitHub Release workflow, and documents how consumers can verify release artifacts.
Changes:
- Update release workflow to generate build provenance and Sigstore bundles, then upload them alongside sdist/wheel assets.
- Document verification steps for signatures and provenance in the release procedure.
- Add a changelog entry announcing signed releases/provenance.
| File | Description |
|---|---|
.github/workflows/release.yml |
Attests build provenance, performs Sigstore signing, and uploads signatures/provenance to the GitHub Release. |
dokimi/docs/releasing.md |
Adds “Verifying a release” section with CLI steps to verify signatures and provenance. |
dokimi/changelog.d/20261105_120000_napetrov_signed-releases.md |
Announces the new signing + provenance release behavior. |
Review effort: Lite
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 | ||
| with: | ||
| subject-path: dist/* | ||
| - name: Sign with Sigstore | ||
| uses: sigstore/gh-action-sigstore-python@790bc6befb9d733738f18d8f895854b453640ec9 # v3.5.0 | ||
| with: | ||
| inputs: dist/* |
| gh release download vX.Y.Z -R intel/dokimi | ||
| # signature: signed by release.yml on the tag | ||
| python -m pip install sigstore | ||
| python -m sigstore verify github dokimi-X.Y.Z-py3-none-any.whl \ | ||
| --bundle dokimi-X.Y.Z-py3-none-any.whl.sigstore.json \ | ||
| --repository intel/dokimi --ref refs/tags/vX.Y.Z --name release | ||
| # provenance, from the attached file (offline) or the repository's attestations | ||
| gh attestation verify dokimi-X.Y.Z-py3-none-any.whl -R intel/dokimi \ | ||
| --signer-workflow intel/dokimi/.github/workflows/release.yml \ | ||
| --bundle dokimi-X.Y.Z.intoto.jsonl |
| - **Signed releases with build provenance** — the release workflow signs the | ||
| sdist and wheel with Sigstore (keyless, the workflow's identity) and attaches | ||
| `<file>.sigstore.json` bundles plus a SLSA build-provenance attestation | ||
| (`dokimi-X.Y.Z.intoto.jsonl`, also in `gh attestation verify`) to the GitHub |
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
| python -m pip install sigstore | ||
| python -m sigstore verify github dokimi-X.Y.Z-py3-none-any.whl \ | ||
| --bundle dokimi-X.Y.Z-py3-none-any.whl.sigstore.json \ | ||
| --repository intel/dokimi --ref refs/tags/vX.Y.Z --name release |
There was a problem hiding this comment.
Must-fix. Impact: the documented Sigstore verification rejects genuine release signatures. Trigger: running this command on a signed wheel (the same problem affects the sdist). Evidence: sigstore verify github --name selects the workflow filename in the certificate identity, not the YAML display name; the signer identity ends in .github/workflows/release.yml@refs/tags/vX.Y.Z, whereas --name release expects .github/workflows/release@refs/tags/vX.Y.Z. Workaround: use --name release.yml. Severity: medium because the advertised verification path fails, although signing itself is unaffected.
Suggestion:
| --repository intel/dokimi --ref refs/tags/vX.Y.Z --name release | |
| --repository intel/dokimi --ref refs/tags/vX.Y.Z --name release.yml |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
=======================================
Coverage 94.78% 94.78%
=======================================
Files 353 354 +1
Lines 46527 46588 +61
Branches 7967 7974 +7
=======================================
+ Hits 44100 44159 +59
- Misses 1540 1541 +1
- Partials 887 888 +1 🚀 New features to boost your workflow:
|
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The attach job orders the steps correctly: provenance is attested on dist/* before signing, so no .sigstore.json is an attestation subject, and the extra permissions are scoped to that job only. The pypi job still receives only the sdist and wheel, because attach uploads no artifact. I agree with Copilot's low point that "also in gh attestation verify" in the changelog fragment reads oddly.
What I ran, on a Linux review host at b9fd10f:
make ci-local: 30 passed, 0 failed, 7 skipped (job conditions, docker/micromamba/semgrep not available).zizmor --offlineonrelease.yml: no findings.mkdocs build --strict: passes, and the#verifying-a-releaseanchor resolves.- Not run: the signing and verification commands. They need a published release, as the description says.
Checked, no issues
- Order and uploads: the
cpof the provenance bundle goes through an env var, andgh release upload dist/*sends the sdist, wheel, bundles and.intoto.jsonl. - Docs and workflow: file names and the
--signer-workflowpath inreleasing.mdmatch what the workflow produces.
Bot points I checked that no longer apply at this head (3)
- Copilot's point on
dist/*does not apply: thedistartifact is built by thebuildjob and holds only the sdist and wheel at the attestation step, and signing runs after it. - Copilot's point on hardcoding
intel/dokimidoes not apply: the commands pin the expected repository on purpose, so a verifier does not accept a signature from another repository. - exai-bot's point on
--name releasedoes not apply:sigstore verify github --namematches the workflow'sname:field (the certificate's workflow-name extension) according to the sigstore-python documentation, andrelease.ymlhasname: release. I did not runsigstore verify, so this is from the documentation.


Summary
Signs release artifacts and attaches build provenance, so OpenSSF Scorecard's Signed-Releases check (0 today) can score.
release.ymlattach job:actions/attest-build-provenanceondist/*: SLSA provenance, also stored in the repo's attestations (gh attestation verify)sigstore/gh-action-sigstore-python: keyless signature per file, using the workflow's OIDC identity →<file>.sigstore.json*.sigstore.jsonanddokimi-X.Y.Z.intoto.jsonlto the releasedocs/releasing.mdgets a "Verifying a release" section.Evidence
tests/test_dependency_locks.pypasses.<file>.sigstore.json, v4.2.2 outputsbundle-path. Both are Scorecard-recognised extensions.Merge danger
Low. Only the release-event job changes, and it now needs
id-token: writeandattestations: write. v0.1.0 stays unsigned, and Scorecard scores the last 5 releases, so the score climbs over the next releases.Self-reviewed locally (pr-review, 2 passes, no blocking left).
🤖 Generated with Claude Code