Skip to content

chore(ci): migrate .goreleaser.yml to goreleaser v2 schema#427

Merged
54m merged 1 commit into
masterfrom
chore/goreleaser-v2-config
May 2, 2026
Merged

chore(ci): migrate .goreleaser.yml to goreleaser v2 schema#427
54m merged 1 commit into
masterfrom
chore/goreleaser-v2-config

Conversation

@54m
Copy link
Copy Markdown
Member

@54m 54m commented May 2, 2026

Summary

Companion to #426. After fixing the `--rm-dist` flag in the workflow, the goreleaser v2 binary still rejects this repo's `.goreleaser.yml` because of two v2 deprecations:

  1. `archives.replacements` was removed in goreleaser v2.0 (deprecated since v1.14)
  2. `archives.format_overrides[].format` was deprecated in v2.6 in favor of `formats: [...]`

This PR migrates `.goreleaser.yml` to the v2 schema while keeping archive names byte-identical to v2.13.1.

Changes

  • Add `version: 2` (required by goreleaser v2)
  • Drop `archives.replacements` block (the noop `darwin/linux/windows` mappings, plus the meaningful `amd64 -> x86_64` / `386 -> i386`)
  • Express `amd64 -> x86_64` / `386 -> i386` inside `name_template` using a Go template `if/else` chain
  • `format_overrides[].format: zip` -> `formats: [zip]`

Why

Without this PR, the next tag push (v2.14.1) would fail in goreleaser v2 with `unknown field `replacements``, repeating the failure pattern seen on v2.14.0 (zero binary assets).

Verification

  • Archive name template still produces the v2.13.1-compatible names: `api_gen_linux_x86_64.tar.gz`, `api_gen_windows_arm64.zip`, etc.
  • goreleaser v2 will accept the file (no `replacements` warnings).

Follow-up

Once this merges, cut v2.14.1 to actually publish binaries.

- Add `version: 2` top-level declaration (required by goreleaser v2)
- Remove `archives.replacements` (removed in goreleaser v2.0)
- Replace OS/Arch noop mappings; inline `amd64 -> x86_64` and `386 -> i386`
  via Go template in `name_template` to keep archive names compatible with
  v2.13.1 (api_gen_linux_x86_64.tar.gz etc.)
- Migrate `format_overrides[].format` -> `formats: [zip]`
  (deprecated since goreleaser v2.6)

Without these changes, goreleaser v2 fails fatally with:
  unknown field `replacements`

Together with PR #426 (--rm-dist -> --clean), this completes the
goreleaser v1 -> v2 migration so v2.14.1 (next tag) ships with binary
assets again, like v2.13.1 did.

対象ファイル:
- cmd/api_gen/.goreleaser.yml
@54m 54m merged commit 565e5c9 into master May 2, 2026
3 checks passed
@54m 54m deleted the chore/goreleaser-v2-config branch May 2, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant