Skip to content

Commit ae44a6f

Browse files
committed
ci: rewrite release workflow to be fully GitHub Actions-driven (#25162)
Replace the local interactive release CLI and legacy shell scripts with a non-interactive Go tool (`scripts/release-action/`) and a rewritten `release.yaml` workflow. Release managers trigger releases from the GitHub Actions UI by selecting a branch, picking a release type (`rc`, `release`, or `create-release-branch`), and optionally providing a commit SHA. The Go tool has four subcommands: `calculate-version` (computes next version from git state), `generate-notes` (release notes from commit log and PR metadata), `publish` (creates GitHub release with checksums), and the workflow handles tag creation, branch creation, building, and downstream publishing. `scripts/version.sh` fallback now uses `git describe` (nearest ancestor tag) instead of global latest so dev builds on release branches show the correct version series. (cherry picked from commit b95697a)
1 parent 443bc1a commit ae44a6f

14 files changed

Lines changed: 2484 additions & 174 deletions

File tree

.github/workflows/release.yaml

Lines changed: 228 additions & 141 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ PLAN.md
103103

104104
# Ignore any dev licenses
105105
license.txt
106+
107+
# Release action build artifact
108+
/release-action

docs/about/contributing/CONTRIBUTING.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -207,55 +207,60 @@ be applied selectively or to discourage anyone from contributing.
207207

208208
## Releases
209209

210-
Coder releases are initiated via
211-
[`./scripts/release.sh`](https://github.com/coder/coder/blob/main/scripts/release.sh)
212-
and automated via GitHub Actions. Specifically, the
210+
Coder releases are managed entirely through the
213211
[`release.yaml`](https://github.com/coder/coder/blob/main/.github/workflows/release.yaml)
214-
workflow.
215-
216-
Release notes are automatically generated from commit titles and PR metadata.
212+
GitHub Actions workflow, triggered manually via "Run workflow" in the Actions
213+
tab. Release notes are automatically generated from commit titles and PR
214+
metadata.
217215

218216
### Release types
219217

220-
| Type | Tag | Branch | Purpose |
221-
|------------------------|---------------|---------------|-----------------------------------------|
222-
| RC (release candidate) | `vX.Y.0-rc.W` | `main` | Ad-hoc pre-release for customer testing |
223-
| Release | `vX.Y.0` | `release/X.Y` | First release of a minor version |
224-
| Patch | `vX.Y.Z` | `release/X.Y` | Bug fixes and security patches |
218+
| Type | Tag | Source | Purpose |
219+
|------------------------|---------------|------------------|---------------------------------------|
220+
| RC (release candidate) | `vX.Y.0-rc.W` | `main` or branch | Pre-release for testing |
221+
| Create release branch | `vX.Y.0-rc.W` | `main` | Cut `release/X.Y` + tag RC atomically |
222+
| Release | `vX.Y.0` | `release/X.Y` | First release of a minor version |
223+
| Patch | `vX.Y.Z` | `release/X.Y` | Bug fixes and security patches |
225224

226225
### Workflow
227226

228-
RC tags are created directly on `main`. The `release/X.Y` branch is only cut
229-
when the release is ready. This avoids cherry-picking main's progress onto
230-
a release branch between the first RC and the release.
227+
RC tags can be created from `main` or from a release branch. The
228+
`create-release-branch` type creates `release/X.Y` and tags the next RC in one
229+
step, continuing the RC numbering sequence.
231230

232231
```text
233-
main: ──●──●──●──●──●──●──●──●──●──
234-
↑ ↑ ↑
235-
rc.0 rc.1 cut release/2.34, tag v2.34.0
236-
\
237-
release/2.34: ──●── v2.34.1 (patch)
232+
main: --*--*--*--*--*--*--*--*--*--
233+
| rc.0 rc.1 |
234+
| +--- create-release-branch ---+
235+
| |
236+
| release/2.34: --*-- rc.2 -- rc.3 -- v2.34.0
237+
|
238+
+-- (more RCs on main for next cycle)
238239
```
239240

240-
1. **RC:** On `main`, run `./scripts/release.sh`. The tool suggests the next
241-
RC version and tags it on `main`.
242-
2. **Release:** When the RC is blessed, create `release/X.Y` from `main` (or
243-
the specific RC commit). Switch to that branch and run
244-
`./scripts/release.sh`, which suggests `vX.Y.0`.
245-
3. **Patch:** Cherry-pick fixes onto `release/X.Y` and run
246-
`./scripts/release.sh` from that branch.
241+
1. **RC:** Go to [Actions > Release](https://github.com/coder/coder/actions/workflows/release.yaml),
242+
click "Run workflow", select `main` (or a release branch) from the "Use
243+
workflow from" dropdown, choose `rc`, and optionally provide a commit SHA
244+
(defaults to HEAD). The workflow calculates the next RC version
245+
automatically.
246+
2. **Create release branch:** Select `main` in the dropdown, choose
247+
`create-release-branch`, and optionally provide a commit SHA. This creates
248+
`release/X.Y` and tags the next RC atomically.
249+
3. **Release:** Select the release branch (e.g. `release/2.34`) from the
250+
dropdown and choose `release`. No other inputs needed.
251+
4. **Patch:** Cherry-pick fixes onto `release/X.Y`, select that branch from
252+
the dropdown, and choose `release`.
247253

248-
The release tool warns if you try to tag a non-RC on `main` or an RC on a
249-
release branch.
254+
The workflow validates that commits are on the expected branch for each release
255+
type.
250256

251-
### Creating a release (via workflow dispatch)
257+
### Retrying a failed release
252258

253259
If the
254260
[`release.yaml`](https://github.com/coder/coder/actions/workflows/release.yaml)
255-
workflow fails after the tag has been pushed, retry it from the GitHub Actions
256-
UI: press "Run workflow", set "Use workflow from" to the tag (e.g.
257-
`Tag: v2.34.0`), select the correct release channel, and do **not** select
258-
dry-run.
261+
workflow fails after the tag has been pushed, re-run the failed jobs from the
262+
GitHub Actions UI. The `prepare-release` job is idempotent and will detect
263+
the existing tag.
259264

260265
To test the workflow without publishing, select dry-run.
261266

0 commit comments

Comments
 (0)