Repository navigation
ci: build and sign main and releases with a shared build-coder action - #32229
Conversation
Move the signed main build and dogfood deploy out of ci.yaml into build.yaml. Both build.yaml and release.yaml now build and sign through .github/actions/build-coder, and ci.yaml's check-build uses it unsigned. Also stop restoring the rcodesign build cache in signing jobs, build it with --locked, and pass the release-signer credentials to rcodesign only.
|
@codex security review |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ba4cb91bb
ℹ️ 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".
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Commits that only touch root Markdown or the docs examples no longer trigger a signed build and dogfood deploy, as with the old ci.yaml job. Also fix two comments that still named release/* and ci.yaml.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
> [!NOTE] > Generated by Coder Agents on behalf of @deansheather. This repository's EV signing service account in `coder-ci` trusts every workflow in the repository, so any branch can sign with Coder's EV certificate. This PR runs the signing jobs in a `code-signing` environment. Only `main` and `v*` tags may deploy to that environment, so coder/gcp can bind the account to the environment instead of the whole repository. - `release.yaml` `release` runs in `code-signing`. - Manual dispatches must be run from `main`. - Pushing `v*` tags now needs admin, maintain, `coder-desktop-release-managers` or `release-managers` (coder/github-org-terraform#56). ## Merge order (all 8 PRs) coder/gcp applies on merge, so the order matters. 1. coder/github-org-terraform#56: the `code-signing` environments, tag rulesets, and coder/coder `release` and `release-publish` allowing `main`. This must be applied before an RC can be dispatched from `main`. 2. coder/gcp#343, then coder/coder#32229 right after. Signed `ci.yaml` builds on `main` fail between those two. `release/2.37` to `2.39` keep signing through `ci.yaml` under #343's temporary rule until 2027-02-16. 3. #192, coder/mutagen#19, coder/pr-buddy#69 and coder/xum#8170. 4. coder/gcp#347. Windows signing in those 4 repos breaks if this lands before step 3. Repository-level secrets and variables (`EV_*`, `GCP_*`) still work from an environment job, so nothing needs to move.
> [!NOTE] > Generated by Coder Agents on behalf of @deansheather. This repository's EV signing service account in `coder-ci` trusts every workflow in the repository, so any branch can sign with Coder's EV certificate. This PR runs the signing jobs in a `code-signing` environment. Only `main` and `v*` tags may deploy to that environment, so coder/gcp can bind the account to the environment instead of the whole repository. - `_desktop-release.yml` `build-windows` (release and nightly builds) runs in `code-signing`. - `pr.yml` `build-windows` uses `code-signing` only on pushes to `main`. Its signing step already ran only on those pushes. Merge queue builds run the queued PR's code, so they get no environment and stay unsigned, which is how they already behaved. - `release.yml` dispatched with a `tag` input now has to be dispatched from `main`. Preflight also requires the input to be a release tag whose commit is on `main`, and every build checks out that commit's SHA. Before, the input was used unchecked as the checkout ref, so a dispatch from `main` could sign any branch or SHA. Codex flagged this too. - xum uses immutable OIDC subjects, so coder/gcp#347 binds `repo:coder@95932066/xum@1058825816:environment:code-signing`. - xum has no `v*` tag ruleset because its nightly workflow creates its own tags. A dispatch can now only build a tag on `main`, but a `release` event runs the workflow file from the tagged commit, so anyone with write access can still push a `v*` tag with an edited workflow and sign. ## Merge order (all 8 PRs) coder/gcp applies on merge, so the order matters. 1. coder/github-org-terraform#56: the `code-signing` environments, tag rulesets, and coder/coder `release` and `release-publish` allowing `main`. This must be applied before an RC can be dispatched from `main`. 2. coder/gcp#343, then coder/coder#32229 right after. Signed `ci.yaml` builds on `main` fail between those two. `release/2.37` to `2.39` keep signing through `ci.yaml` under #343's temporary rule until 2027-02-16. 3. coder/coder-desktop-windows#192, coder/mutagen#19, coder/pr-buddy#69 and #8170. 4. coder/gcp#347. Windows signing in those 4 repos breaks if this lands before step 3. Repository-level secrets and variables (`EV_*`, `GCP_*`) still work from an environment job, so nothing needs to move.
Note
Generated by Coder Agents on behalf of @deansheather.
Main builds and releases now build and sign through one shared composite action, so they can't drift apart. PR builds use the same action unsigned, in a job with no environment, so they can't reach signing secrets or identities.
Depends on coder/gcp#343, which must merge first. The
release-signeridentity provider only accepts tag-dispatched releases andci.yaml. Since #32211 made that login unconditional, releases and non-push main runs already fail today.Changes
.github/actions/build-coder(new): tool setup, thenmakefor the given targets. Withsign: trueit signs darwin binaries with the Apple key in Cloud KMS, Windows binaries with EV, and everything with GPG (the legacy key plus the optional KMS key). Withnotarize: trueit also notarizes. Composite actions can't read secrets, so callers pass them in.$RUNNER_TEMP/coder-signingdirectory with mode 700 and is removed withif: always()..github/workflows/build.yaml(new): the signed main andrelease/*build, moved out ofci.yaml.pushtomainandrelease/*(ignoring the same docs-only paths asci.yaml'schangesfilter), pluscreateforrelease/*. Nopull_requestorworkflow_dispatch. Top-levelpermissions: {}.buildjob runs inci-signing. It builds and signs, pushescoder-previewtags, then runs SBOM, image attestations and binary attestations (new), and uploads artifacts.prunerunsaction-ghcr-prunein its own job, away from the signing credentials.deploycallsdeploy.yaml.notify-slack-on-failurecovers build, prune and deploy failures on main.ci.yaml:buildanddeployjobs are removed.check-buildnow runsmake build-slimthrough the action, unsigned. That compile-checks all 7 OS/arch targets without the frontend and fat builds.check-buildalso runs when CI files change.release.yaml:notarize: true. Tagging, base image, images, attestations and publishing are unchanged.refs/tags/*KMS gate is removed.release-signercredentials from the action's output.install-rcodesigngains ause-cacheinput, which signing jobs set tofalse. Depot caches are shared across branches, so a PR could otherwise plant a binary under the cache key that a signing job would run with signing credentials.cargo install --lockedpins rcodesign's dependency tree. I verified the lockfile resolves with the patch at the pinned revision.sign_darwin.shtakesAC_PKCS11_CREDENTIALS_FILEand setsGOOGLE_APPLICATION_CREDENTIALSonly forrcodesign. Therelease-signercredentials no longer reach the wholemakestep.Validation
make lint/actions/actionlintpasses. zizmor (offline, strict collection) reports no findings. shellcheck passes on everyrunblock in the composite actions..ascand.v2.ascfiles, rcodesign and jsign output,coder-preview:mainpushed and dogfood deployed. A release dry run frommaincoversrelease.yamlonce Create Workspaces CRUD API #56 lets thereleaseenvironment run onmain; release branches still carry the oldrelease.yaml.Follow-ups (manual)
AC_CERTIFICATE_P12_BASE64andAC_CERTIFICATE_PASSWORD.stablethe runner has. Rebuilding rcodesign without the cache adds a few minutes to each signed build.The
releaseenvironment changes and the release-branchci.yamlsigning are handled in coder/github-org-terraform#56 and coder/gcp#343.Merge order (all 8 PRs)
coder/gcp applies on merge, so the order matters.
code-signingenvironments, tag rulesets, and coder/coderreleaseandrelease-publishallowingmain. This must be applied before an RC can be dispatched frommain.ci.yamlbuilds onmainfail between those two.release/2.37to2.39keep signing throughci.yamlunder refactor: Add nightly test stability workflow (aka The Gauntlet) #343's temporary rule until 2027-02-16.Plan and decision log
Goal: main and
release/*pushes build coderd fully, sign everything (EV, Apple, GPG and KMS GPG) the same way releases do, pushcoder-preview, and deploy dogfood. PRs get a compile check with no signing access.Verified constraints:
ci-signingandreleaseenvironments. There are none at the repo or org level.ci-signingallowsmainandrelease/*.releaserequiresrelease-managerswith self-review prevented, and admins can't bypass.ev-code-signing(coder-ci) andrelease-signer(coder-release-signing) are bound only to theenvironment:ci-signingandenvironment:releasesubjects.release-signerprovider condition checksjob_workflow_ref. A reusable workflow would change that claim, so the shared code is a composite action that runs inside the caller's job. This also keeps the release job as a single job, with no artifact handoff between build and publish.Decisions:
build.yaml.build.yaml.release/*still getscoder-preview:release-X.Yimages.check-buildbuilds slim binaries only, which keeps the cross-compile coverage at a fraction of the cost.