Skip to content

Commit 366ca4f

Browse files
authored
Replace removed goreleaser archives.replacements configuration (#349)
The `archives.replacements` field from the `goreleaser` configuration file was [removed](https://goreleaser.com/deprecations/#archivesreplacements). It's stopping us from releasing a new version: ``` goreleaser release --clean • starting release... ⨯ release failed after 0s error=yaml: unmarshal errors: line 25: field replacements not found in type config.Archive ``` The suggested alternative is to use `archives.name_template`. Tested by running `goreleaser release --skip publish` locally, inspecting the built archive names, and comparing them to past releases: ``` • archives • creating archive=dist/grpcui_1.4.2_linux_x86_32.tar.gz • creating archive=dist/grpcui_1.4.2_windows_x86_64.zip • creating archive=dist/grpcui_1.4.2_linux_x86_64.tar.gz • creating archive=dist/grpcui_1.4.2_linux_arm64.tar.gz • creating archive=dist/grpcui_1.4.2_osx_arm64.tar.gz • creating archive=dist/grpcui_1.4.2_windows_x86_32.zip • creating archive=dist/grpcui_1.4.2_osx_x86_64.tar.gz ```
1 parent 491995b commit 366ca4f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.goreleaser.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ archives:
2222
format_overrides:
2323
- goos: windows
2424
format: zip
25-
replacements:
26-
amd64: x86_64
27-
386: x86_32
28-
darwin: osx
25+
name_template: >-
26+
{{ .Binary }}_{{ .Version }}_
27+
{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}_
28+
{{- if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}x86_32{{ else }}{{ .Arch }}{{ end }}
29+
{{- with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}
2930
files:
3031
- LICENSE

0 commit comments

Comments
 (0)