molecule-cli/.goreleaser.yaml
Hongming Wang 76569b7c9e ci(release): switch release.yml to GoReleaser + race-detector tests
After this PR the release pipeline produces a real out-of-box install
story for molecule-cli — multi-OS binaries with checksums, archived
with shell completions, plus a CI gate that catches races in the
new connect orchestrator.

What changed:

- `.github/workflows/release.yml`
  * Vet now scans `./...` (was: three packages); silently let
    regressions in internal/backends/ + internal/connect/ ship.
  * Test now runs `-race -count=1 ./...` (was: just `cmd/molecule`
    without race). The connect orchestrator runs heartbeat + poll
    goroutines concurrently — a race here would corrupt cursor state.
  * Release job switches from inline `go build` per matrix entry to
    `goreleaser release --clean`. Same multi-OS output, plus
    auto-generated changelog, checksum files, and one config file
    that future channels (brew tap, scoop, choco) hook into without
    new workflow steps.
  * `goreleaser check` runs first so a broken .goreleaser.yaml fails
    fast at validation, not partway through a build.
  * Path filter expanded so .goreleaser.yaml edits trigger CI.

- `.goreleaser.yaml`
  * Pre-generate shell completions in the before: hook so the archive
    can include them. (`molecule completion <shell>` still works at
    runtime — this just ships the files for users who prefer a
    drop-in setup.)
  * Update archive `formats:` (plural) for goreleaser v2 — `format:`
    was deprecated.
  * Drop the redundant per-archive checksum block; the top-level
    `checksum:` covers it.
  * Header comment rewritten to reflect that this is now the
    canonical release path (was: "wire it up when ready").

Test plan:

- [x] yaml parses for both files
- [x] `go test -race -count=1 ./...` green
- [ ] CI on this PR exercises the new test job (vet ./..., -race ./...)
- [ ] First tag push (v0.1.0) exercises the release job

After merge, cutting v0.1.0 is:
  git tag v0.1.0 && git push origin v0.1.0
  # → Release artifacts auto-built and published to GitHub Releases

This is M1.4 of [RFC #10](https://github.com/Molecule-AI/molecule-cli/issues/10).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 05:30:31 -07:00

73 lines
1.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GoReleaser configuration for molecule-cli
# https://goreleaser.com/install/
#
# Used by .github/workflows/release.yml on tag push (refs/tags/v*).
# Produces multi-OS binaries (linux/darwin/windows × amd64/arm64),
# tar.gz/zip archives that include pre-generated shell completions,
# a sha256 checksums file, and a GitHub Release.
#
# Run locally:
# goreleaser check — validate the config
# goreleaser release --snapshot --clean — dry-run build (no upload)
version: 2
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
# Pre-generate shell completions so the archive ships them. Users
# can drop completions/molecule.bash into ~/.bash_completion.d/, etc.
# `molecule completion <shell>` also still works at runtime.
- mkdir -p completions
- sh -c 'go run ./cmd/molecule completion bash > completions/molecule.bash'
- sh -c 'go run ./cmd/molecule completion zsh > completions/_molecule'
- sh -c 'go run ./cmd/molecule completion fish > completions/molecule.fish'
builds:
- id: molecule
dir: .
main: ./cmd/molecule
binary: molecule
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0
flags:
- -trimpath
archives:
- id: default
formats: [tar.gz]
format_overrides:
- goos: windows
formats: [zip]
files:
- src: completions/**/*
dst: completions
snapshot:
name_template: "{{.Tag}}-snapshot"
checksum:
name_template: 'molecule_{{.Os}}_{{.Arch}}_{{.Version}}_checksums.txt'
algorithm: sha256
release:
github:
owner: Molecule-AI
name: molecule-cli
draft: false
name_template: "{{.Tag}}"
# Homebrew tap formula is managed by .github/workflows/release.yml
# (separate workflow step updates the formula on tag push).
# If GoReleaser takes over Homebrew later, add a brew section here.