Repository navigation
ci: releases need a second approver and come only from attested builds - #8143
Conversation
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>
| - 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/ |
There was a problem hiding this comment.
Is there a reason we copy to a new dir instead of using the release-packages dir directly? (and one above too)
There was a problem hiding this comment.
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.
|
|
||
| - run: npm run package | ||
| - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 | ||
| - run: mkdir -p release-files && cp release-packages/* release-files/ |
There was a problem hiding this comment.
Same fix: uses release-packages/* directly now (8ea5411).
| npm run package | ||
| - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 | ||
| - run: mkdir -p release-files && cp release-packages/* release-files/ |
There was a problem hiding this comment.
Same fix: uses release-packages/* directly now (8ea5411).
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>
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
Start it: merge the
update/<VS Code version>PR (as today), or run Release (release.yaml) by hand onmainwith the version and the full SHA of a commit on main.prepareworks out the version (sameupdate/1.106.0→4.106.0rule as before) and checks that the commit is on main. A dispatch from any other branch is refused.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:
actions/attest-build-provenance);approvewaits in therelease-approvalenvironment for a member ofcode-server-release-teamother than the person who started the run. Then it:release.yaml,refs/heads/main, GitHub-hosted runners);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'sUnreleasedsection as notes.Releases are immutable, so nothing can change after that.
gh release createdrafts and publishes within the same command; a draft left by an interrupted attempt is cleaned up on re-run.publish.yamlstarts onrelease: released, as before. A newverifyjob must pass before npm, Docker Hub, GHCR and the AUR run. It checks that the release:coder-release-publisher[bot];release.yamlfrom main.The manual dispatch stays as a backup, behind the same checks.
Release candidates: dispatch with
-rc.Nand "pre-release". npm, Docker and the AUR still skip pre-releases.Asset names,
package.tar.gz, the.deb/.rpmfilesinstall.shand Docker use, the npm trusted publisher (publish.yaml, envrelease) and the Docker Hub OIDC subject (environment:release) are all unchanged.Before merging (in this order)
coder-release-publishergets a consumer forcoder/code-server, envrelease-approval,/.github/workflows/release.yaml@refs/heads/main.release-approvalenvironment (code-server-release-team, prevent self-review, main only);releaseenvironment's reviewers removed, since approval now happens inrelease-approval;coder-release-publisheris installed on code-server, and therelease-approvalenvironment secrets are set (CODER_RELEASE_PUBLISHER_APP_ID,CODER_RELEASE_PUBLISHER_APP_KMS_KEY,APP_KEYS_WORKLOAD_ID_PROVIDER).Release tagsruleset (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.
actionlintshows only issues already present on main.zizmor --offlinereports fewer findings than on main and nothing new. Prettier passes.🤖 Generated with Claude Code