Skip to content

ci: releases need a second approver and come only from attested builds - #8143

Merged
kylecarbs merged 3 commits into
mainfrom
release-approval
Nov 19, 2026
Merged

kylecarbs merged 3 commits into
mainfrom
release-approval

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

Moves code-server releases to the model coder/coder, the VS Code extension, the JetBrains plugins and registry.coder.com already use: one person starts a release, a second person approves it, and only then are the tag and the release created.

@code-asher, please review. This changes how you release (see docs/MAINTAINING.md).

How a release works now

  1. Start it: merge the update/<VS Code version> PR (as today), or run Release (release.yaml) by hand on main with the version and the full SHA of a commit on main.

  2. prepare works out the version (same update/1.106.0 → 4.106.0 rule as before) and checks that the commit is on main. A dispatch from any other branch is refused.

  3. Build jobs (Linux x64/arm64, macOS x64/arm64, Windows) build exactly as before, from that commit. Instead of uploading to a draft release, each one:

    • attests its files (actions/attest-build-provenance);
    • uploads them as a workflow artifact.
  4. approve waits in the release-approval environment for a member of code-server-release-team other than the person who started the run. Then it:

    • re-checks the tag: rerun-safe, versions only go up, and the commit is not older than the last release;
    • verifies every file's attestation (release.yaml, refs/heads/main, GitHub-hosted runners);
    • as coder-release-publisher (its key is in Cloud KMS, and only this job of main's copy may sign with it), creates the annotated tag and publishes the release with those files and the changelog's Unreleased section as notes.

    Releases are immutable, so nothing can change after that. gh release create drafts and publishes within the same command; a draft left by an interrupted attempt is cleaned up on re-run.

  5. publish.yaml starts on release: released, as before. A new verify job must pass before npm, Docker Hub, GHCR and the AUR run. It checks that the release:

    • was made by coder-release-publisher[bot];
    • is published and immutable;
    • has every asset attested by release.yaml from main.

    The manual dispatch stays as a backup, behind the same checks.

Release candidates: dispatch with -rc.N and "pre-release". npm, Docker and the AUR still skip pre-releases.

Asset names, package.tar.gz, the .deb/.rpm files install.sh and Docker use, the npm trusted publisher (publish.yaml, env release) and the Docker Hub OIDC subject (environment:release) are all unchanged.

Before merging (in this order)

  1. coder/gcp: coder-release-publisher gets a consumer for coder/code-server, env release-approval, /.github/workflows/release.yaml@refs/heads/main.
  2. coder/github-org-terraform:
    • the release-approval environment (code-server-release-team, prevent self-review, main only);
    • the release environment's reviewers removed, since approval now happens in release-approval;
    • App-only release tags.
  3. coder-release-publisher is installed on code-server, and the release-approval environment secrets are set (CODER_RELEASE_PUBLISHER_APP_ID, CODER_RELEASE_PUBLISHER_APP_KMS_KEY, APP_KEYS_WORKLOAD_ID_PROVIDER).
  4. This PR merges.
  5. Delete the old Release tags ruleset (code-asher bypass) by hand, before the first release. It doesn't let the App create tags, and rulesets stack.

Also delete the stale v4.145.3 draft release before releasing 4.145.3 this way, or the approve job stops and asks for it to be removed.

actionlint shows only issues already present on main. zizmor --offline reports fewer findings than on main and nothing new. Prettier passes.

🤖 Generated with Claude Code

The Release workflow builds the packages from a commit on main (the merge commit of an update/
PR, or a commit given to a dispatch on main) and attests each file's provenance. A member of
code-server-release-team other than the person who started the run then approves the
release-approval environment. Only that job, as the coder-release-publisher App (key in Cloud
KMS), creates the tag and publishes the release with the attested files, in one step. Releases
are immutable, so the files can't change after that, and there is no draft for anyone to edit.

publish.yaml publishes nothing until it has checked that the release came from
coder-release-publisher, is immutable, and that every file was attested by release.yaml from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs requested a review from a team as a code owner November 18, 2026 23:56

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment thread .github/workflows/release.yaml Outdated
- run: KEEP_MODULES=1 npm run release
- run: npm run package
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
- run: mkdir -p release-files && cp release-packages/* release-files/

@code-asher code-asher Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we copy to a new dir instead of using the release-packages dir directly? (and one above too)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good reason, thanks. It was only needed on linux x64, where package.tar.gz was built at the repo root: upload-artifact keeps paths relative to their common parent, so uploading it alongside release-packages/* would have nested release-packages/ in the artifact. The other jobs copied just for consistency. Fixed in 8ea5411: package.tar.gz is now written straight into release-packages/, and every job attests and uploads release-packages/* directly.

Comment thread .github/workflows/release.yaml Outdated

- run: npm run package
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
- run: mkdir -p release-files && cp release-packages/* release-files/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same fix: uses release-packages/* directly now (8ea5411).

Comment thread .github/workflows/release.yaml Outdated
npm run package
- uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
- run: mkdir -p release-files && cp release-packages/* release-files/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same fix: uses release-packages/* directly now (8ea5411).

kylecarbs and others added 2 commits November 18, 2026 19:50
package.tar.gz is now written into release-packages next to the platform packages, so every build
job attests and uploads one flat directory without a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs enabled auto-merge (squash) November 19, 2026 00:52
@kylecarbs
kylecarbs merged commit e7ff0c4 into main Nov 19, 2026
10 checks passed
@kylecarbs
kylecarbs deleted the release-approval branch November 19, 2026 00:54
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.

2 participants