Repository navigation
ci: verify the draft release's files before publishing - #216
Merged
Merged
Conversation
release.yml now uploads to the draft, then a read-only verify job checks the draft's files (names, SHA256SUMS, attestation, version, install.sh in a clean container), and publish runs only when verify passed and the draft still has the verified files. verify-release.yml has a dry run that can break a file on purpose. Fixes #200 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A verify gate in the release: the files of the draft release are checked before the release is published. When a check fails, the release stays a draft and nothing is public.
Fixes #200
Changes behavior for existing callers: no
What changes
release.yml: the oldpublishjob is now three jobs.upload(as before: checks, attestation, bundle check, upload to the draft). Then it downloads the draft's files back (a draft can only be read with write access) and passes them on as an artifact.verifycalls.github/workflows/verify-release.ymlwith read access only. It runsscripts/verify-release.sh:SHA256SUMS, the bundle);SHA256SUMSnames each tarball once, and each matches;gh attestation verifyoffline with the bundle and the production identity (release.yml@refs/heads/main,--deny-self-hosted-runners), and the bundle names exactly the tarballs ofSHA256SUMS;v<version>, its CPU, the release commit and a clean checkout (no qemu needed for arm64); the amd64 binary also printsnodkey <version>;install.shof the release installs the draft's tarball as root in a cleandebian:trixiecontainer, with the pinned gh and the real bundle. Onlygithub.comandapi.github.comare a local HTTPS server there, because draft files are not public.publishneedsverifyand only runsgh release edit --draft=false.verify-release.ymlalso has aworkflow_dispatchdry run: it takes a published release, can break a file on purpose (tarball,tarball-and-sums,extra-file), runs the same checks, and awould-publishjob shows whether the publish would run. It publishes nothing.docs/releasing.md: "The verify gate", the dry run, and the steps after a failure. THREAT-MODEL.md: a note on the gate.TestVerifyReleaseinscripts_linux_test.go(fake gh, go and docker): good files pass; an extra file, a missing file, a changed tarball, a shortSHA256SUMS, a failed attestation, a bundle with other subjects, a binary of another commit, and a failed install each fail.One point not done as written
The issue says "delete the draft and the tag, release again". The ruleset for
v*tags does not let anybody delete a tag (docs/releasing.md, "Repository settings"). So the docs say: delete the draft, the tag stays, and the fix ships in the next version. I asked on #200 whether the ruleset should change.Evidence
scripts/verify-release.shon the real published 0.7.0 files: all checks pass, also the install with the real gh and bundle.SHA256SUMS(check 3 fails: the attestation and the bundle subjects), an extra file (check 1 fails).workflow_dispatchneeds the workflow onmain).Progress
upload/verify/publish,publishneedsverifyscripts/verify-release.shand tests of its deny pathspublishneeds theverifiedoutput (a skipped verify does not count), the summary is written also on failure,--source-digestties the attestation to the commit,publishchecks that the draft still has the verified files (asset digests), the version is not echoed in errors, more deny-path tests.break=nonepasses,break=tarballstopswould-publish🤖 Generated with Claude Code