Skip to content

ci: create release tags and branches with the release App after approval - #32212

Merged
kylecarbs merged 3 commits into
mainfrom
release-from-ci
Nov 16, 2026
Merged

kylecarbs merged 3 commits into
mainfrom
release-from-ci

Conversation

@kylecarbs

@kylecarbs kylecarbs commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Unblocks releases after the coder/coder lockdown. Only the coder-release-publisher App can now create tags and release branches (rulesets "Release tags (App only)" and "Release branch creation", managed in coder/github-org-terraform). Its key is only available in environments that need a second release manager's approval (release-managers, no self-review, no admin bypass). People can't push release tags anymore, so the tag is now created inside the approved release run.

Releasing (./scripts/release.sh works as before, minus one step)

  1. Run ./scripts/release.sh on release/X.Y (or main for an RC), as today. It still picks the version, checks open PRs and breaking changes, and writes the release notes.
  2. Instead of creating and pushing the tag, it checks the commit is already on origin/<branch> and dispatches release.yaml on the branch with version, commit, release_channel and release_notes.
  3. The releaser prints the run's URL. GitHub also notifies the release-managers reviewers. Another release manager approves the run's release environment (Review deployments).
  4. The approved job creates the annotated tag version at commit with the App, then builds, signs and publishes that commit as before.

release.yaml can also be run by hand from the Actions UI with the same inputs.

release.yaml

  • New version and commit inputs (required unless dry_run).

  • The release job checks out commit. Before anything else, it:

    • refuses a malformed version;
    • refuses a version that doesn't match the branch (release/X.Y, or main/release/X.Y for -rc.N);
    • refuses a commit that isn't already on the dispatched branch;
    • refuses an existing tag that points elsewhere;
    • otherwise creates the annotated tag with the App. A re-run reuses a tag already at that commit.

    version.sh and the rest of the job are unchanged.

  • Homebrew and the coder/packages dispatch use the new coder-package-publisher App (release-publish environment) instead of CDRCI_GITHUB_TOKEN. The dispatch moves to its own publish-packages job in release-publish, where that key lives; it's approved together with Homebrew and winget. Winget still uses the cdrci machine user, since an App can't open PRs on microsoft/winget-pkgs.

  • Every App token is scoped to one repository and the permissions it needs (zizmor's github-app audit: 5 high findings to 0, one of which predates this PR).

create-release-branch.yaml (new)

Dispatched on main with version (e.g. 2.40) and commit. After approval in the release-refs environment, it creates release/X.Y at that commit, refusing one that isn't on main or a branch that already exists.

scripts/releaser

  • ReleaseExecutor drops CreateTag/PushTag.
  • TriggerWorkflow dispatches on the branch with version and commit.
  • An existing tag must already point at HEAD.
  • After dispatching, it looks up the run (gh run list, polling briefly) and prints its URL and the approval steps.

Before merging

  • RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY set in the release-refs environment (currently empty), and the rotated release App key in release.
  • CODER_PACKAGE_PUBLISHER_APP_ID / CODER_PACKAGE_PUBLISHER_APP_PRIVATE_KEY in release-publish; App installed on homebrew-coder and packages.

After merging: backport to every branch you release from

release.yaml runs from the dispatched branch's own copy, and ./scripts/release.sh runs the branch's releaser. So each release/X.Y needs this change before it can release. Active lines by recent tags: release/2.39, 2.38, 2.37, 2.36, 2.35, 2.34, 2.29.

Relation to #31321

#31321 (Tag release) runs the releaser non-interactively in CI. This PR is the smaller change that unblocks releases now. #31321 can build on it: its tagging job would need environment: release-refs (where the App key lives) plus the extra App permissions it asks for, which are a manifest change in coder/github-org-terraform apps/.

Testing

  • go build, go vet, go test ./scripts/releaser pass.
  • actionlint and zizmor are clean on both workflows.
  • Not exercised end to end. Suggest the first use be an RC (v2.40.0-rc.N from main), watching the tag step.

🤖 Generated with Claude Code

Only coder-release-publisher may now create tags and release branches in
coder/coder (rulesets "Release tags (App only)" and "Release branch
creation"), and its key is only available in environments that need a
second release manager's approval. People can no longer push release
tags, so:

- release.yaml takes `version` and `commit` inputs and runs on
  release/X.Y (or main for an RC). The approved release job creates the
  annotated tag at `commit` with the App, after checking the version
  matches the branch and the commit is already on it, then builds that
  commit as before. Re-runs reuse a tag already at that commit.
- scripts/releaser no longer creates or pushes the tag: it checks the
  commit is on origin/<branch> and dispatches release.yaml on the branch
  with version and commit.
- create-release-branch.yaml (dispatched on main, approved in the
  release-refs environment) creates release/X.Y at a commit on main.
- Homebrew and the coder/packages dispatch use the coder-publisher App
  (release-publish environment) instead of the cdrci token; winget still
  needs the machine user. The packages dispatch moves to its own job in
  release-publish, where that key lives.
- Every App token is scoped to the repository and permissions it needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:35 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:36 — with GitHub Actions Inactive
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:40 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:40 — with GitHub Actions Inactive
sreya
sreya previously approved these changes Nov 16, 2026
After dispatching release.yaml, look up the run (gh run list, polling
briefly since a dispatch doesn't return it) and print its URL with what
happens next: another release manager approves the release environment,
then the run creates the tag and publishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:46 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:46 — with GitHub Actions Inactive
@kylecarbs
kylecarbs merged commit 12766ec into main Nov 16, 2026
33 of 34 checks passed
@kylecarbs
kylecarbs deleted the release-from-ci branch November 16, 2026 00:54
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:54 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2026
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 00:57 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 01:01 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 01:01 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 01:01 — with GitHub Actions Inactive
@kylecarbs
kylecarbs temporarily deployed to main November 16, 2026 01:01 — with GitHub Actions Inactive

This branch had an error being deployed

1 failed and 1 inactive deployments
main — 7318d9cc Deployed Nov 16, 2026 by kylecarbs via Backport to release/2.34 #7003
docs-preview — 7318d9cc Deployed Nov 16, 2026 by kylecarbs via cleanup #72
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants