Skip to content

ci(release): release workflow with gates on the artifacts — ADR-0053/0054/0055 (M4, M5) - #253

Merged
gonzafg2 merged 1 commit into
mainfrom
ci/release-workflow-adr-0053
Nov 4, 2026
Merged

gonzafg2 merged 1 commit into
mainfrom
ci/release-workflow-adr-0053

Conversation

@gonzafg2

@gonzafg2 gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

This adds .github/workflows/release.yml and the gates it runs: milestones M4 and M5 of docs/plans/alpha-distribution.md. They land together because ADR-0053 attests nothing until every ADR-0055 gate has passed on the exact bytes, so the workflow is not complete without its gates.

A v* or rehearsal-* tag runs:

Job Permissions Does
precheck contents: read The tagged commit must be an ancestor of origin/main. A v* tag must also be annotated and pass the pinned signature check against keys/security.asc and keys/release-keys.txt read from origin/main, never from the tag's tree.
build ×3 contents: read Runs cargo build --release --locked -p quantumssh --target <t> on ubuntu-24.04, ubuntu-24.04-arm and macos-26, so nothing is cross-compiled. Then come the static-link check, the tarball, and a build-env-<t>.txt with ImageOS, ImageVersion and rustc -vV.
sbom contents: read cargo-cyclonedx 0.5.9 on its own runner, which never holds a tarball.
gates contents: read interop.yml on both Linux tarballs; macOS interop against OpenSSH 10.6p1 built from the tarball pinned by SHA-256; the systemd reference unit on the x86_64 tarball's own binary and unit. Each records the digest of the tarball it ran.
attest contents: read, id-token: write, attestations: write Fails unless the four gate records match the three built tarballs exactly. Then it attests the tarballs and the SBOM. It runs no project code.
publish contents: write Writes SHA256SUMS and creates a draft release with exactly those five assets. The notes carry the build environments.

No cache action runs, here or in the workflows it calls, and every checkout drops its credentials.

Pieces

  • scripts/release/check-binary.sh (ADR-0053 §3).
    • Linux: no NEEDED, no PT_INTERP, and --version runs inside a pinned Alpine with the binary mounted read-only and no network.
    • macOS: otool -L lists only /usr/lib.
    • On a v* tag, the version must equal the tag's.
  • scripts/release/package.sh (RFC-0017 §3). The binary, LICENSE, README.md, CHANGELOG.md, the systemd unit, and config.toml, copied from the TOML block of docs/deployment.md §4.
  • scripts/release/pinned-signature-check.sh (ADR-0054 §7). Reads GnuPG status lines. It passes only on a VALIDSIG by the pin set's current key, with no REVKEYSIG, KEYREVOKED, BADSIG, EXPKEYSIG or EXPSIG. A retired key is refused here, because accepting one needs the published release's window and digest checks; that belongs to verify-download.sh (M7).
  • keys/release-keys.txt. The pin set, with one current key.
  • interop.yml (ADR-0055 §1).
    • It gains workflow_call with artifact and runner inputs. On that path it skips the toolchain, the cache and the build, extracts the tarball and records its digest before running it.
    • The concurrency group now includes the runner, and a release gate is never cancelled. Under workflow_call, github.workflow is the caller's, so the two Linux legs would otherwise cancel each other.
    • The pull-request path behaves as before, apart from persist-credentials: false.
  • openssh_aes_gcm (ADR-0055 §5). It is mandatory wherever the client offers [email protected], and skipped, with a message, otherwise.
  • tests/systemd/run_in_docker.sh. It replaces the inline Docker steps in ci.yml, and the release workflow uses it with an extracted tarball.

Decisions this PR makes within the ADRs

  • One SBOM covers three targets. It uses --target all, so it lists a superset of what any single binary holds, never a subset. cargo-cyclonedx writes one file per workspace member, and only the quantumssh one is published.
  • One attestation for all four files. It covers the four subjects, and gh attestation verify <file> passes for each of them.
  • The macOS runner is macos-26. It is the newest versioned arm64 label on 2026-11-03.

What stays for later

  • ADR status. ADR-0053 and ADR-0055 stay Proposed until a rehearsal tag runs the workflow end to end on main. That run will confirm the macOS OpenSSH build on the runner, which auto mode did not let me run here. ADR-0054 also needs scripts/verify-release.sh, verify-download.sh and the docs (M7, M8).
  • The v* tag ruleset is a repository setting, created after this merges, with the maintainer's OK.

Refs #248

Test plan

  • actionlint on every workflow; shellcheck on every script
  • Pinned signature check:
    • git verify-tag --raw v0.1.0 passes;
    • empty input, revoked, KEYREVOKED, expired, BADSIG, another key, mixed signers and NO_PUBKEY fail;
    • a real GnuPG revocation, in Docker: bare gpg --verify exits 0 and the check refuses with REVKEYSIG.
  • Static-link check in Docker (rust:1.99.1, arm64):
    • the aarch64-unknown-linux-musl build is EXEC with no dynamic section and no INTERP, and runs in the pinned Alpine;
    • a wrong expected version fails;
    • a glibc build checked as musl fails on its three NEEDED entries.
  • package.sh: the tarball lists exactly the RFC-0017 §3 files, and config.toml is the §4 example.
  • The systemd gate through run_in_docker.sh on the extracted aarch64 musl tarball: SYSTEMD PASS.
  • The attest job's digest check, with fixtures: it passes on the real layout, where macOS shasum lines are mixed with sha256sum lines. It fails on a tampered tarball, a tarball no gate ran, a missing record, an extra tarball and a two-line record.
  • The interop gate on macOS with OpenSSH 10.6p1 (Homebrew, with OpenSSL): ok: openssh_aes_gcm and INTEROP PASS.
  • The PR-time openssh-interop in forky, which now runs openssh_aes_gcm
  • After merge: a rehearsal-* tag on main, with gh attestation verify and the four pins on every asset
  • Reviewers: Claude Code Review, Codex, opencode

…ts (ADR-0053, ADR-0054, ADR-0055)

A v* or rehearsal-* tag builds the three release targets, gates the exact
bytes, attests them and the SBOM, and creates a draft release. Each job
holds only its own permissions, no cache action runs, and every checkout
drops its credentials.

- precheck (contents: read): the tagged commit must be an ancestor of
  main. A v* tag must also be annotated and pass the pinned signature
  check against keys/security.asc and keys/release-keys.txt read from
  origin/main.
- build (contents: read): one job per target on its own architecture
  (ubuntu-24.04, ubuntu-24.04-arm, macos-26), `cargo build --release
  --locked -p quantumssh --target <t>`. Then the static-link check, the
  tarball, and a record of ImageOS, ImageVersion and `rustc -vV`.
- sbom (contents: read): cargo-cyclonedx 0.5.9 on its own runner, with
  `--target all` so one SBOM covers every target.
- gates (contents: read): interop.yml is now callable with a release
  tarball (both Linux targets); macOS interop against an OpenSSH 10.6p1
  client built from the tarball pinned by SHA-256, with a check that no
  tool falls back to the system client; the systemd reference unit on the
  x86_64 tarball's own binary and unit. Each records the digest of what it
  ran.
- attest (id-token, attestations): fails unless the four gate records
  match the three built tarballs exactly, then attests the tarballs and
  the SBOM. It runs no project code.
- publish (contents: write): SHA256SUMS and a draft release holding
  exactly those five assets, with the build environments in the notes.

New scripts: scripts/release/check-binary.sh (no NEEDED, no PT_INTERP,
--version inside a pinned Alpine; otool on macOS; the tag's version),
package.sh (RFC-0017 §3 contents) and pinned-signature-check.sh (ADR-0054
§7 for the current key). keys/release-keys.txt is the pin set.
tests/systemd/run_in_docker.sh now drives the reference unit for both CI
and the release workflow.

The interop gate gains openssh_aes_gcm (ADR-0055 §5), mandatory wherever
the client offers [email protected].

The ADRs stay Proposed until a rehearsal tag runs the workflow end to end.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

gonzafg2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

/oc

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T22:09:43.257505Z 6d68ae1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 6d68ae1246

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@claude

claude Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

PR Review: ci(release): release workflow with gates on the artifacts — ADR-0053/0054/0055 (M4, M5) (#253)

Decision: 🟢 Approved
Iteration: First review
Lenses applied: CI under .github/workflows/, shell scripts under scripts/release/ and tests/systemd/, CLAUDE.md compliance

Executive summary

This PR adds the complete tag-triggered release workflow (M4/M5) implementing ADR-0053, ADR-0054, and ADR-0055. The design is sound: every job holds minimal permissions, all actions are pinned by SHA, there is no cache on the release path, and attestation is blocked until all four gate records match the three built tarballs. No CLAUDE.md violations, no logic errors, and no supply-chain risks were found in the diff.

No issues found. Checked for bugs and CLAUDE.md compliance.

@gonzafg2
gonzafg2 merged commit b5e7cd3 into main Nov 4, 2026
14 checks passed
@gonzafg2
gonzafg2 deleted the ci/release-workflow-adr-0053 branch November 4, 2026 01:00
gonzafg2 added a commit that referenced this pull request Nov 4, 2026
* docs(adr): ADR-0053 and ADR-0055 are Accepted

Both were implemented in #253. The rehearsal run 41751733656 on
rehearsal-0.2.0-1 then passed end to end: three static builds, the SBOM,
the four gates on the artifacts, the attestations and the draft. The
draft held exactly five assets, the attestations verified under the
rehearsal ref and failed under refs/tags/v0.2.0, SHA256SUMS matched a
recomputation byte for byte, and the four gate records matched it. The
draft and the tag were deleted afterwards (ADR-0053 §4).

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(adr): ADR-0057 is Accepted

Its Date line said "accepted on merge", and it merged in #250, but the
Status line still read Proposed. ADR-0006 already records the part of
its wording that ADR-0057 supersedes.

Refs #248

Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
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.

1 participant