mirror of
https://github.com/coder/coder.git
synced 2026-11-22 19:39:23 +08:00
dependabot/github_actions/github-actions-fe5f304cd8
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
12766eca93 |
ci: create release tags and branches with the release App after approval (#32212)
## 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`. - [x] `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](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
591f357574 |
chore: remove releaser v2 flow and drop v1 naming (#27421)
## Summary Removes the GitHub Actions-driven releaser **v2** pipeline so the interactive release wizard is the only release path, and drops the `v1` naming now that it is the sole implementation. ## Changes - Delete `.github/workflows/tag-and-release.yaml` (the v2 workflow). - Delete `scripts/releaser/v2/`. - Move `scripts/releaser/v1/` into `scripts/releaser/` as `package main`. - Rewrite `scripts/releaser/main.go` to a single wizard command: drop the `--legacy` flag and the v2 `rc`/`branch`/`release` subcommands and hidden CI compat commands. `--dry-run` is preserved. - Update `scripts/release.sh` to run `go run ./scripts/releaser "$@"` (no `--legacy`). The legacy `release.yaml` workflow (triggered by `scripts/release.sh`) is unchanged and remains the release pipeline. ## Validation - `go build ./scripts/releaser/...` - `go test ./scripts/releaser/...` - `go vet` + `golangci-lint run ./scripts/releaser/...` - `gofmt -l` clean > [!NOTE] > The GPG signing key check removal is handled in a stacked follow-up PR based on this branch. <details> <summary>Implementation plan</summary> - v2 flow = `scripts/releaser/v2/` + `.github/workflows/tag-and-release.yaml` (uses `go run ./scripts/releaser prepare-release|generate-notes`). `v2` was imported only by `main.go`; the workflow was referenced nowhere else. - v1 flow = interactive wizard in `scripts/releaser/v1/`, reached via `--legacy`, driving `release.yaml` (triggered by `scripts/release.sh`). - No `docs/` referenced the releaser tool or these workflows. - Steps: delete the v2 workflow and package; move `v1/*` up to `scripts/releaser/` (`package main`, including test files); rewrite `main.go` to a single wizard command; update `release.sh`. </details> --- Generated by Coder Agents on behalf of @f0ssel. |
||
|
|
bfbacd64f4 |
refactor: consolidate release tooling into a single releaser command (#27034)
## What Consolidates the two separate release programs into a single command at `scripts/releaser`: - `scripts/releaser/v1/` — the former interactive releaser (package `v1`). - `scripts/releaser/v2/` — the former `scripts/release-action` CI tool (package `v2`). - `scripts/releaser/main.go` — new entrypoint. Runs the **v2** tooling by default and the **v1** interactive wizard with `--legacy`. ## CLI shape Three documented subcommands, each backed by v2 `prepare-release` with the release type baked in: - `releaser rc` — tag a release candidate - `releaser branch` — cut a new release branch and tag its first RC - `releaser release` — tag a stable release or patch The former release-action verbs (`calculate-version`, `prepare-release`, `generate-notes`, `publish`) are retained as **hidden** top-level commands with identical flags and stdout, so `tag-and-release.yaml` migrates with a path-only change (`scripts/release-action` -> `scripts/releaser`). `--legacy` runs the v1 wizard and is mutually exclusive with the subcommands. `scripts/release.sh` now launches `releaser --legacy`. All file moves are rename-detected by git, so the per-file diff is just the package declaration. ## Testing - `go build ./scripts/...`, `go vet ./scripts/releaser/...`, `go test ./scripts/releaser/...` - `golangci-lint run ./scripts/releaser/...`, `make lint/emdash`, `shellcheck`, `actionlint` - Smoke: `releaser --help` shows only rc/branch/release; hidden verbs still run; `releaser rc --ref main --dry-run` emits the same JSON contract; `--legacy rc` errors cleanly. <details> <summary>Implementation plan</summary> # Plan: Consolidate release tooling into a single `scripts/releaser` command ## Goal Merge the two separate release programs into one binary at `scripts/releaser`: - `scripts/releaser/v1/` — the current interactive releaser (package `v1`). - `scripts/releaser/v2/` — the current CI `scripts/release-action` (package `v2`). - `scripts/releaser/main.go` — new entrypoint (package `main`). - Uses v2 by default, v1 with `--legacy`. - Exposes 3 subcommands: `rc`, `branch` (cut release branch), `release`. ## Design decision (Option A, chosen) The workflow needs `prepare-release`, `generate-notes`, and `publish` invokable separately (a build happens between prepare and publish). The latter two are version-driven and type-agnostic, so they do not map cleanly onto `rc`/`branch`/`release`. - Visible subcommands `rc`, `branch`, `release` run v2 `prepare-release` with the type baked in and print the same JSON. - Hidden verbs `calculate-version`, `prepare-release`, `generate-notes`, `publish` keep byte-identical flags/stdout, so the workflow change is path-only. Lowest risk; honors "3 subcommands" from a UX perspective. ## `--legacy` semantics - `releaser --legacy` runs the v1 interactive wizard (preserves today's behavior; the wizard auto-detects RC vs release from the branch). - `--legacy` is mutually exclusive with the subcommands (clear error if combined), because v1 auto-detects type and cannot cut a branch. ## Work items 1. Create `v1` and `v2` packages via `git mv`, renaming `package main`. Move the `owner`/`repo` consts into each package. Add `v1.Run(inv, dryRun)` (old wizard `main()` body) and v2 command builders (`CICommands`, `TypeCommand`) so internals stay unexported. 2. New `scripts/releaser/main.go`: top-level `releaser` with `--legacy`, the 3 subcommands, and the hidden compat verbs; delegates to `v1.Run` for legacy. 3. Update references: `tag-and-release.yaml` (3 command paths + header comment) and `scripts/release.sh` (`--legacy`). 4. Verify: build, vet, test, `go run` smoke tests, fmt, lint. 5. Open a single PR from a feature branch. ## Risks / notes - stdout contract for rc/branch/release and the hidden verbs must stay identical (workflow parses stdout); logs go to stderr. - Patch releases from pre-existing `release/X.Y` branches run those branches' own (old) workflow + `scripts/release-action`, so they stay self-consistent. New releases cut from branches containing this change get the new workflow + `scripts/releaser`. No forwarding stub needed since code and workflow ship together. </details> --- This PR was created by Coder Agents on behalf of @f0ssel. |
||
|
|
1f5f6c9ccb | chore: add new interactive release package (#22624) |