1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-05 13:15:26 +02:00

docs: conventional file name on armv6

refs https://github.com/charmbracelet/meta/pull/116
This commit is contained in:
Carlos Alexandro Becker 2023-11-02 12:32:31 +00:00
parent 9c54dda3ba
commit 3a3cf610f8
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 31 additions and 2 deletions

View File

@ -340,8 +340,13 @@ func doTestRunPipeConventionalNameTemplate(t *testing.T, snapshot bool) {
Homepage: "https://goreleaser.com/",
Bindir: "/usr/bin",
NFPMOverridables: config.NFPMOverridables{
FileNameTemplate: `{{ trimsuffix (trimsuffix (trimsuffix (trimsuffix .ConventionalFileName ".pkg.tar.zst") ".deb") ".rpm") ".apk" }}{{ if not (eq .Amd64 "v1")}}{{ .Amd64 }}{{ end }}`,
PackageName: "foo{{ if .IsSnapshot }}-snapshot{{ end }}",
FileNameTemplate: `
{{- trimsuffix .ConventionalFileName .ConventionalExtension -}}
{{- if and (eq .Arm "6") (eq .ConventionalExtension ".deb") }}6{{ end -}}
{{- if not (eq .Amd64 "v1")}}{{ .Amd64 }}{{ end -}}
{{- .ConventionalExtension -}}
`,
PackageName: "foo{{ if .IsSnapshot }}-snapshot{{ end }}",
},
},
},
@ -437,6 +442,7 @@ func doTestRunPipeConventionalNameTemplate(t *testing.T, snapshot bool) {
prefix + "_1.0.0_arm64.deb",
prefix + "_1.0.0_armhf.apk",
prefix + "_1.0.0_armhf.deb",
prefix + "_1.0.0_armhf6.deb",
prefix + "_1.0.0_armv7.apk",
prefix + "_1.0.0_i386.deb",
prefix + "_1.0.0_mips.apk",

View File

@ -456,3 +456,26 @@ Termux is the same format as `deb`, the differences are:
- it uses a different `bindir` (prefixed with `/data/data/com.termux/files/`)
- it uses slightly different architecture names than Debian
## Conventional file names, Debian, and ARMv6
On Debian, both ARMv6 and ARMv7 have the same architecture name: `armhf`.
If you use `{{.ConventionalFileName}}`, and build for both architectures, you'll
get duplicated file names.
You can go around that with something like this:
```yaml
# .goreleaser.yaml
nfpms:
-
# ...
file_name_template: >-
{{- trimsuffix .ConventionalFileName .ConventionalExtension -}}
{{- if and (eq .Arm "6") (eq .ConventionalExtension ".deb") }}6{{ end -}}
{{- if not (eq .Amd64 "v1")}}{{ .Amd64 }}{{ end -}}
{{- .ConventionalExtension -}}
# ...
```