Skip to content

Commit

Permalink
Replace removed goreleaser archives.replacements configuration (#349)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
gpassini authored Nov 29, 2024
1 parent 491995b commit 366ca4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ archives:
format_overrides:
- goos: windows
format: zip
replacements:
amd64: x86_64
386: x86_32
darwin: osx
name_template: >-
{{ .Binary }}_{{ .Version }}_
{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}x86_32{{ else }}{{ .Arch }}{{ end }}
{{- with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}
files:
- LICENSE

0 comments on commit 366ca4f

Please sign in to comment.