Skip to content

feat(release): build, attest and publish the release at its tag, and deploy production from it - #186

Merged
aRustyDev merged 2 commits into
mainfrom
feat/release-attest-deploy
Nov 15, 2026
Merged

aRustyDev merged 2 commits into
mainfrom
feat/release-attest-deploy

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

What

PR 3 of the CI/CD plan (.agents/plans/cicd-review/PLAN.md): a release gets attested assets, and production deploys the release. Per your decision of 2026-11-15, the bundle is built once, at the tag, rather than promoted from staging.

The path, end to end

  1. Release candidate. release-plz keeps rc/<timestamp> up to date, and ci runs in full on its PR. With the switch on, staging deploys it (PR 2).

  2. Merge. release-plz tags vX.Y.Z and now creates the release as a draft (git_release_draft = true). Releases are immutable once published, so assets have to go on while it's a draft. release-plz's source shows it creates the tag through the API before the release (create_git_tag_and_release), so the tag exists when the draft does.

  3. release.yml (new) is started by the draft's release: created event. It checks the draft is for a v<version> tag whose commit is on main and that the tag points at it, then:

    • build (no secret):
      • builds the bundle at the tag;
      • makes an SPDX SBOM of the source with anchore/sbom-action (syft pinned to v1.54.0), and checks the SBOM lists both Rust crates and web packages;
      • attests the bundle's build provenance (actions/attest-build-provenance) and the SBOM as a statement about it (actions/attest).
    • publish (contents: write, the only writer):
      • re-checks the release is still a draft of this tag at this commit;
      • attaches the bundle, sbom.spdx.json and SHA256SUMS, then publishes;
      • checks the release is immutable, and that GitHub's own attestation verifies (gh release verify, gh release verify-asset).
  4. Production. When ci passes on the tagged merge commit, deploy.yml dispatches a production deploy on the tag, which waits for your approval. Same THRUST_DEPLOY_ENABLED switch; a manual run from the tag works too. Production builds nothing. The deploy action fetches the release's asset through fetch-release-bundle.sh, which refuses:

    • a draft;
    • a release that isn't immutable;
    • zero bundles, or more than one;
    • a file gh release verify-asset doesn't vouch for.

    verify-bundle.sh then requires release.yml as the signer for a v* tag (deploy.yml for rc/*), and unpack-bundle.sh requires BUILD_SHA to be the tag's commit.

All of these are public, built-in tools: GitHub's attest actions, anchore/sbom-action, GitHub's immutable-release attestation, and gh release verify-asset. The hand-written parts are the glue: which ref, which release, and refusing anything else.

Changes

File Change
release-plz.toml git_release_draft = true
.github/workflows/release.yml New, as above. A PR that edits it or the build runs build as a dry run, with nothing attested or published
.github/actions/build-bundle The bundle build, moved out of deploy.yml, so both workflows build it the same way
deploy.yml workflow_run also on main. Production dispatch on the tag. build runs for staging only. The deploy jobs run with build skipped for production
plan-deploy.sh Production dispatch when the commit carries exactly one v<version> tag (RUN_TAGS from git tag --points-at, with globbing off); a release output
fetch-release-bundle.sh New, with a test
verify-bundle.sh Signer chosen by ref
Docs New release.md (the path, how to check a release, what to do when a step fails). cicd.md and deploy.md updated. ADR-0110 gets a dated update, the repository's way of amending an ADR. PLAN.md

Tests

  • test-plan-deploy.sh: 14,850 checks over every combination. The new cases: tags none, one, one plus another, two, non-release, v1/x, v; and a control showing RUN_TAGS isn't globbed.
  • test-fetch-release-bundle.sh (new): 31 checks. Each refusal sits next to the one case it accepts, and a tag that isn't a release tag is refused before gh is asked anything.
  • test-verify-bundle.sh: the signer for each kind of ref.
  • 22 hand mutants, all caught by their tests. The first run left one alive: an "at least one tag" check whose removal changed only the skip's reason. I added an assertion on the reason.
  • Locally: every ci-scripts test and deps guard under dash, lint-workflow.sh over release.yml and the new action, and actionlint.

Not verified until it runs

  • release.yml for real. Merging chore(release): v0.1.0 #184 (v0.1.0) will be the first run. It shows whether:

    • the App can create a v* tag through the tag ruleset without the Administration permission;
    • the draft starts release.yml;
    • publishing makes the release immutable and GitHub attests it.

    The PR dry run here only proves the file starts, the SBOM covers both lockfiles, and the bundle builds.

  • The SBOM attestation's predicate type in the release.md check command (https://spdx.dev/Document/v2.3) is what actions/attest should derive from syft's SPDX 2.3. Confirm it on v0.1.0.

  • The production deploy itself, which waits on chore(cd): deploy pipeline per ADR-0110 round 29 (expand, deploy 100 %, smoke, auto-rollback) #49's prerequisites (production has no variables or secrets yet).

  • Production's "previous release" web files come from release.yml's 90-day artifact. Reading them from the release itself is a follow-up.

Refs: #49

🤖 Generated with Claude Code

aRustyDev and others added 2 commits November 15, 2026 15:35
…deploy production from it

The owner's decision of 2026-11-15: build once at the tag rather than
promote staging's bundle. The tag points at main's squash commit, not
the rc commit staging deployed, and the deploy uses the commit as the
Worker's version and diffs it against the live one in git.

- release-plz.toml: git_release_draft. release-plz creates the tag
  through the API before the release (create_git_tag_and_release in its
  source), so the tag exists when the draft does; published releases
  are immutable, so assets go on while it is a draft.
- release.yml (new), on the draft's creation (a v<version> tag on
  main): build the bundle at the tag, an SPDX SBOM of the source
  (anchore/sbom-action, syft pinned), attest both (attest-build-
  provenance, actions/attest), attach the bundle, the SBOM and
  SHA256SUMS, publish, and check GitHub's own release attestation
  (gh release verify, verify-asset). A pull request that edits it runs
  the build as a dry run.
- .github/actions/build-bundle: the bundle build, moved out of
  deploy.yml so both workflows build it the same way.
- deploy.yml: ci passing on a push to main whose commit carries exactly
  one v* tag dispatches the production deploy on that tag (it waits for
  the reviewers). Production builds nothing: the action fetches the
  release's asset (fetch-release-bundle.sh: published, immutable, one
  bundle, gh release verify-asset). The deploy jobs run with build
  skipped for production.
- plan-deploy.sh: the production dispatch from RUN_TAGS (not globbed),
  and a `release` output naming the release a production deploy uses.
- verify-bundle.sh: release.yml is the signer for a v* tag, deploy.yml
  for an rc/* branch.
- Docs: release.md (the path, checking a release, recovery), cicd.md,
  deploy.md, ADR-0110's update of 2026-11-15, PLAN.md.

Tests: test-plan-deploy.sh (14850 checks over every combination),
test-verify-bundle.sh, and the new test-fetch-release-bundle.sh; 22
hand mutants of the three scripts, each caught.

Refs: #49
Co-Authored-By: Claude Opus 5.5 <[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