Skip to content

Commit 9d81316

Browse files
Copilotyxxhero
andcommitted
Add multi-arch support for Linux architectures in GoReleaser and install script
Co-authored-by: yxxhero <[email protected]>
1 parent 494b60d commit 9d81316

17 files changed

+204
-2
lines changed

.goreleaser.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,37 @@ builds:
2121
goarch:
2222
- amd64
2323
- arm64
24+
ignore:
25+
- goos: freebsd
26+
goarch: arm64
27+
- goos: windows
28+
goarch: arm64
29+
- id: linux-additional
30+
main: .
31+
binary: bin/diff
32+
env:
33+
- CGO_ENABLED=0
34+
flags:
35+
- -trimpath
36+
ldflags:
37+
- -X github.com/databus23/helm-diff/v3/cmd.Version={{ .Version }}
38+
goos:
39+
- linux
40+
goarch:
41+
- arm
42+
- ppc64le
43+
- s390x
44+
goarm:
45+
- "6"
46+
- "7"
2447

2548
archives:
2649
- id: default
2750
builds:
2851
- default
52+
- linux-additional
2953
format: tgz
30-
name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}'
54+
name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
3155
wrap_in_directory: diff
3256
files:
3357
- README.md

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ dist:
7676
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-amd64.tgz diff/
7777
GOOS=linux GOARCH=arm64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
7878
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-arm64.tgz diff/
79+
GOOS=linux GOARCH=arm GOARM=6 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
80+
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-armv6.tgz diff/
81+
GOOS=linux GOARCH=arm GOARM=7 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
82+
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-armv7.tgz diff/
83+
GOOS=linux GOARCH=ppc64le $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
84+
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-ppc64le.tgz diff/
85+
GOOS=linux GOARCH=s390x $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
86+
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-s390x.tgz diff/
7987
GOOS=freebsd GOARCH=amd64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
8088
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-freebsd-amd64.tgz diff/
8189
GOOS=darwin GOARCH=amd64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"

dist/artifacts.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"name":"metadata.json","path":"dist/metadata.json","internal_type":30,"type":"Metadata"},{"name":"bin/diff","path":"dist/default_linux_amd64_v1/bin/diff","goos":"linux","goarch":"amd64","goamd64":"v1","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"default"}},{"name":"bin/diff","path":"dist/default_freebsd_amd64_v1/bin/diff","goos":"freebsd","goarch":"amd64","goamd64":"v1","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"default"}},{"name":"bin/diff","path":"dist/default_linux_arm64/bin/diff","goos":"linux","goarch":"arm64","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"default"}},{"name":"bin/diff","path":"dist/linux-additional_linux_arm_6/bin/diff","goos":"linux","goarch":"arm","goarm":"6","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"linux-additional"}},{"name":"bin/diff","path":"dist/linux-additional_linux_arm_7/bin/diff","goos":"linux","goarch":"arm","goarm":"7","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"linux-additional"}},{"name":"bin/diff","path":"dist/linux-additional_linux_ppc64le/bin/diff","goos":"linux","goarch":"ppc64le","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"linux-additional"}},{"name":"bin/diff","path":"dist/linux-additional_linux_s390x/bin/diff","goos":"linux","goarch":"s390x","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"linux-additional"}},{"name":"bin/diff","path":"dist/default_darwin_amd64_v1/bin/diff","goos":"darwin","goarch":"amd64","goamd64":"v1","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"default"}},{"name":"bin/diff","path":"dist/default_darwin_arm64/bin/diff","goos":"darwin","goarch":"arm64","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":"","ID":"default"}},{"name":"bin/diff.exe","path":"dist/default_windows_amd64_v1/bin/diff.exe","goos":"windows","goarch":"amd64","goamd64":"v1","internal_type":4,"type":"Binary","extra":{"Binary":"diff","Ext":".exe","ID":"default"}},{"name":"helm-diff-linux-armv6.tgz","path":"dist/helm-diff-linux-armv6.tgz","goos":"linux","goarch":"arm","goarm":"6","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:cbc16608df76f935937b5612b30ff760f300b0ef3ebdf723a3759f2497ee300f","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-macos-arm64.tgz","path":"dist/helm-diff-macos-arm64.tgz","goos":"darwin","goarch":"arm64","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:386cb8cd12b490cb3edd9c433b0f17b6966aeb38e06ad2f8b14433d3bbcd943e","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-windows-amd64.tgz","path":"dist/helm-diff-windows-amd64.tgz","goos":"windows","goarch":"amd64","goamd64":"v1","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff.exe"],"Checksum":"sha256:a788311ce755d51f36232b24ae0192337bb44fe4b5694e62d11125692a802b18","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-linux-amd64.tgz","path":"dist/helm-diff-linux-amd64.tgz","goos":"linux","goarch":"amd64","goamd64":"v1","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:8c682083fcac0f8a5a0fe82f702865c186ab71a4ff25eaa40bf24051dcc15b4b","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-linux-ppc64le.tgz","path":"dist/helm-diff-linux-ppc64le.tgz","goos":"linux","goarch":"ppc64le","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:7bfb64bf16a13192937c9fb41606ede0cdddd831ca8ddabad21f098352bebe05","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-macos-amd64.tgz","path":"dist/helm-diff-macos-amd64.tgz","goos":"darwin","goarch":"amd64","goamd64":"v1","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:967693d7449dc8c91280b89e256b230417219ff3523b5da78f9c9f0c2f72eef1","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-linux-arm64.tgz","path":"dist/helm-diff-linux-arm64.tgz","goos":"linux","goarch":"arm64","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:7de8916e6111b3eb96b65b537b9a2a997b04a9ca43288297659c8cd83ce4b2ad","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-freebsd-amd64.tgz","path":"dist/helm-diff-freebsd-amd64.tgz","goos":"freebsd","goarch":"amd64","goamd64":"v1","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:0b0ef3fc389fde542a22f8e27831a0920191cfb2c270cd8f0700cdd896d20e3f","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-linux-armv7.tgz","path":"dist/helm-diff-linux-armv7.tgz","goos":"linux","goarch":"arm","goarm":"7","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:9c35bc43ad5ce0742141885b7395c8e8dde745c42c4d3d2c09db91936e2cca01","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff-linux-s390x.tgz","path":"dist/helm-diff-linux-s390x.tgz","goos":"linux","goarch":"s390x","internal_type":1,"type":"Archive","extra":{"Binaries":["bin/diff"],"Checksum":"sha256:10e6901e3ba9c27c2f9969d584068abc04f78ca3cf80a46f6a85fe204bca5346","Format":"tgz","ID":"default","Replaces":null,"WrappedIn":"diff"}},{"name":"helm-diff_0.0.0-SNAPSHOT-494b60d_checksums.txt","path":"dist/helm-diff_0.0.0-SNAPSHOT-494b60d_checksums.txt","internal_type":12,"type":"Checksum","extra":{}}]

dist/config.yaml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
project_name: helm-diff
2+
release:
3+
github:
4+
owner: databus23
5+
name: helm-diff
6+
prerelease: auto
7+
name_template: '{{.Tag}}'
8+
builds:
9+
- id: default
10+
goos:
11+
- freebsd
12+
- darwin
13+
- linux
14+
- windows
15+
goarch:
16+
- amd64
17+
- arm64
18+
goarm:
19+
- "6"
20+
gomips:
21+
- hardfloat
22+
goamd64:
23+
- v1
24+
targets:
25+
- freebsd_amd64_v1
26+
- darwin_amd64_v1
27+
- darwin_arm64
28+
- linux_amd64_v1
29+
- linux_arm64
30+
- windows_amd64_v1
31+
ignore:
32+
- goos: freebsd
33+
goarch: arm64
34+
- goos: windows
35+
goarch: arm64
36+
dir: .
37+
main: .
38+
binary: bin/diff
39+
builder: go
40+
gobinary: go
41+
command: build
42+
ldflags:
43+
- -X github.com/databus23/helm-diff/v3/cmd.Version={{ .Version }}
44+
flags:
45+
- -trimpath
46+
env:
47+
- CGO_ENABLED=0
48+
- id: linux-additional
49+
goos:
50+
- linux
51+
goarch:
52+
- arm
53+
- ppc64le
54+
- s390x
55+
goarm:
56+
- "6"
57+
- "7"
58+
gomips:
59+
- hardfloat
60+
goamd64:
61+
- v1
62+
targets:
63+
- linux_arm_6
64+
- linux_arm_7
65+
- linux_ppc64le
66+
- linux_s390x
67+
dir: .
68+
main: .
69+
binary: bin/diff
70+
builder: go
71+
gobinary: go
72+
command: build
73+
ldflags:
74+
- -X github.com/databus23/helm-diff/v3/cmd.Version={{ .Version }}
75+
flags:
76+
- -trimpath
77+
env:
78+
- CGO_ENABLED=0
79+
archives:
80+
- id: default
81+
builds:
82+
- default
83+
- linux-additional
84+
name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
85+
format: tgz
86+
wrap_in_directory: diff
87+
files:
88+
- src: README.md
89+
- src: plugin.yaml
90+
- src: LICENSE
91+
snapshot:
92+
name_template: '{{ .Version }}-SNAPSHOT-{{ .ShortCommit }}'
93+
checksum:
94+
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
95+
algorithm: sha256
96+
changelog:
97+
use: github-native
98+
format: '{{ .SHA }}: {{ .Message }} ({{ with .AuthorUsername }}@{{ . }}{{ else }}{{ .AuthorName }} <{{ .AuthorEmail }}>{{ end }})'
99+
dist: dist
100+
env_files:
101+
github_token: ~/.config/goreleaser/github_token
102+
gitlab_token: ~/.config/goreleaser/gitlab_token
103+
gitea_token: ~/.config/goreleaser/gitea_token
104+
source:
105+
name_template: '{{ .ProjectName }}-{{ .Version }}'
106+
format: tar.gz
107+
gomod:
108+
gobinary: go
109+
announce:
110+
twitter:
111+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
112+
mastodon:
113+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
114+
server: ""
115+
reddit:
116+
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
117+
url_template: '{{ .ReleaseURL }}'
118+
slack:
119+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
120+
username: GoReleaser
121+
discord:
122+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
123+
author: GoReleaser
124+
color: "3888754"
125+
icon_url: https://goreleaser.com/static/avatar.png
126+
teams:
127+
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
128+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
129+
color: '#2D313E'
130+
icon_url: https://goreleaser.com/static/avatar.png
131+
smtp:
132+
subject_template: '{{ .ProjectName }} {{ .Tag }} is out!'
133+
body_template: 'You can view details from: {{ .ReleaseURL }}'
134+
mattermost:
135+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
136+
title_template: '{{ .ProjectName }} {{ .Tag }} is out!'
137+
username: GoReleaser
138+
linkedin:
139+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
140+
telegram:
141+
message_template: '{{ mdv2escape .ProjectName }} {{ mdv2escape .Tag }} is out{{ mdv2escape "!" }} Check it out at {{ mdv2escape .ReleaseURL }}'
142+
parse_mode: MarkdownV2
143+
webhook:
144+
message_template: '{ "message": "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"}'
145+
content_type: application/json; charset=utf-8
146+
opencollective:
147+
title_template: '{{ .Tag }}'
148+
message_template: '{{ .ProjectName }} {{ .Tag }} is out!<br/>Check it out at <a href="{{ .ReleaseURL }}">{{ .ReleaseURL }}</a>'
149+
bluesky:
150+
message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}'
151+
git:
152+
tag_sort: -version:refname
153+
github_urls:
154+
download: https://github.com
155+
gitlab_urls:
156+
download: https://gitlab.com

dist/helm-diff-freebsd-amd64.tgz

33 MB
Binary file not shown.

dist/helm-diff-linux-amd64.tgz

33.1 MB
Binary file not shown.

dist/helm-diff-linux-arm64.tgz

31 MB
Binary file not shown.

dist/helm-diff-linux-armv6.tgz

30.3 MB
Binary file not shown.

dist/helm-diff-linux-armv7.tgz

30.3 MB
Binary file not shown.

dist/helm-diff-linux-ppc64le.tgz

30.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)