Skip to content

ci: verify the draft release's files before publishing - #216

Merged
groupsky merged 1 commit into
mainfrom
hq-job/nodkey-release-ci-2/200-verify-gate
Nov 18, 2026
Merged

groupsky merged 1 commit into
mainfrom
hq-job/nodkey-release-ci-2/200-verify-gate

Conversation

@groupsky

@groupsky groupsky commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 old publish job 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.
    • verify calls .github/workflows/verify-release.yml with read access only. It runs scripts/verify-release.sh:
      1. exactly the expected files (four tarballs, SHA256SUMS, the bundle);
      2. SHA256SUMS names each tarball once, and each matches;
      3. gh attestation verify offline with the bundle and the production identity (release.yml@refs/heads/main, --deny-self-hosted-runners), and the bundle names exactly the tarballs of SHA256SUMS;
      4. each binary's build info says v<version>, its CPU, the release commit and a clean checkout (no qemu needed for arm64); the amd64 binary also prints nodkey <version>;
      5. install.sh of the release installs the draft's tarball as root in a clean debian:trixie container, with the pinned gh and the real bundle. Only github.com and api.github.com are a local HTTPS server there, because draft files are not public.
    • publish needs verify and only runs gh release edit --draft=false.
  • verify-release.yml also has a workflow_dispatch dry run: it takes a published release, can break a file on purpose (tarball, tarball-and-sums, extra-file), runs the same checks, and a would-publish job 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.
  • Tests: TestVerifyRelease in scripts_linux_test.go (fake gh, go and docker): good files pass; an extra file, a missing file, a changed tarball, a short SHA256SUMS, 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

  • Local run of scripts/verify-release.sh on the real published 0.7.0 files: all checks pass, also the install with the real gh and bundle.
  • Broken copies: one byte more in a tarball (checks 2 and 3 fail), the same with a matching SHA256SUMS (check 3 fails: the attestation and the bundle subjects), an extra file (check 1 fails).
  • Dry-run workflow runs on GitHub are linked on ci: check the draft release's files before publishing (checksums, attestation, version, clean install) #200 after the merge (workflow_dispatch needs the workflow on main).

Progress

  • upload / verify / publish, publish needs verify
  • scripts/verify-release.sh and tests of its deny paths
  • Docs
  • Security review: no fail-open path found. All six low findings fixed: publish needs the verified output (a skipped verify does not count), the summary is written also on failure, --source-digest ties the attestation to the commit, publish checks that the draft still has the verified files (asset digests), the version is not echoed in errors, more deny-path tests.
  • CI green (after re-runs of flaky tests in code this PR does not touch: test/contract trial broker stop, and on main also internal/broker TestLoginRememberedTimer and nolintlint in internal/store)
  • Dry runs on GitHub (after merge): break=none passes, break=tarball stops would-publish

🤖 Generated with Claude Code

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>
@groupsky
groupsky marked this pull request as ready for review November 18, 2026 20:01
@groupsky
groupsky merged commit 1be4fae into main Nov 18, 2026
20 of 23 checks passed
@groupsky
groupsky deleted the hq-job/nodkey-release-ci-2/200-verify-gate branch November 18, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: check the draft release's files before publishing (checksums, attestation, version, clean install)

1 participant