mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
## 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.
50 lines
1.4 KiB
Go
50 lines
1.4 KiB
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/coder/coder/v2/cli/cliui"
|
|
"github.com/coder/pretty"
|
|
"github.com/coder/serpent"
|
|
)
|
|
|
|
// outputPrefix is prepended to every message line. Set to
|
|
// "[DRYRUN] " when running in dry-run mode.
|
|
var outputPrefix string
|
|
|
|
// warnf prints a yellow warning to stderr.
|
|
func warnf(w io.Writer, format string, args ...any) {
|
|
pretty.Fprintf(w, cliui.DefaultStyles.Warn, outputPrefix+format+"\n", args...)
|
|
}
|
|
|
|
// infof prints a cyan info message to stderr.
|
|
func infof(w io.Writer, format string, args ...any) {
|
|
pretty.Fprintf(w, cliui.DefaultStyles.Keyword, outputPrefix+format+"\n", args...)
|
|
}
|
|
|
|
// successf prints a green success message to stderr.
|
|
func successf(w io.Writer, format string, args ...any) {
|
|
pretty.Fprintf(w, cliui.DefaultStyles.DateTimeStamp, outputPrefix+format+"\n", args...)
|
|
}
|
|
|
|
// confirm asks a yes/no question. Returns nil if the user confirms,
|
|
// or a cancellation error otherwise.
|
|
func confirm(inv *serpent.Invocation, msg string) error {
|
|
_, err := cliui.Prompt(inv, cliui.PromptOptions{
|
|
Text: msg,
|
|
IsConfirm: true,
|
|
})
|
|
return err
|
|
}
|
|
|
|
// confirmWithDefault asks a yes/no question with the specified
|
|
// default ("yes" or "no").
|
|
func confirmWithDefault(inv *serpent.Invocation, msg, def string) error {
|
|
_, err := cliui.Prompt(inv, cliui.PromptOptions{
|
|
Text: msg,
|
|
IsConfirm: true,
|
|
Default: def,
|
|
})
|
|
return err
|
|
}
|