Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ vendor/
bin/
build/
release/
dist/
.envrc
.idea
docker-run-release-cache/
Expand Down
26 changes: 25 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,37 @@ builds:
goarch:
- amd64
- arm64
ignore:
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why we should add those code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ignore section prevents GoReleaser from building unsupported platform combinations.

The default build includes both freebsd and windows in goos, and arm64 in goarch. Without these ignore rules, GoReleaser would build all combinations including freebsd-arm64 and windows-arm64.

However, the install script only supports:

  • freebsd-amd64 (not arm64)
  • windows-amd64 (not arm64)

So these ignore rules prevent building binaries that users cannot install, avoiding unnecessary build artifacts and potential confusion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we can add those into install script. so please remove ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the ignore section from GoReleaser configuration and added freebsd-arm64 and windows-arm64 to the install script's supported platforms list. Now GoReleaser will build binaries for all architecture combinations and users on those platforms can successfully install the plugin. Commit: 45d47da

- id: linux-additional
main: .
binary: bin/diff
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -X github.com/databus23/helm-diff/v3/cmd.Version={{ .Version }}
goos:
- linux
goarch:
- arm
- ppc64le
- s390x
goarm:
- "6"
- "7"

archives:
- id: default
builds:
- default
- linux-additional
format: tgz
name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}'
name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
wrap_in_directory: diff
files:
- README.md
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ dist:
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-amd64.tgz diff/
GOOS=linux GOARCH=arm64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-arm64.tgz diff/
GOOS=linux GOARCH=arm GOARM=6 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-armv6.tgz diff/
GOOS=linux GOARCH=arm GOARM=7 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-armv7.tgz diff/
GOOS=linux GOARCH=ppc64le $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-ppc64le.tgz diff/
GOOS=linux GOARCH=s390x $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-linux-s390x.tgz diff/
GOOS=freebsd GOARCH=amd64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
tar -C build/ -zcvf $(CURDIR)/release/helm-diff-freebsd-amd64.tgz diff/
GOOS=darwin GOARCH=amd64 $(GO) build -o build/diff/bin/diff -trimpath -ldflags="$(LDFLAGS)"
Expand Down
4 changes: 3 additions & 1 deletion install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ initArch() {
x86_64) ARCH="amd64" ;;
i686) ARCH="386" ;;
i386) ARCH="386" ;;
ppc64le) ARCH="ppc64le" ;;
s390x) ARCH="s390x" ;;
esac
}

Expand All @@ -69,7 +71,7 @@ initOS() {
# verifySupported checks that the os/arch combination is supported for
# binary builds.
verifySupported() {
supported="linux-amd64\nlinux-arm64\nfreebsd-amd64\nmacos-amd64\nmacos-arm64\nwindows-amd64"
supported="linux-amd64\nlinux-arm64\nlinux-armv6\nlinux-armv7\nlinux-ppc64le\nlinux-s390x\nfreebsd-amd64\nmacos-amd64\nmacos-arm64\nwindows-amd64"
if ! echo "${supported}" | grep -q "${OS}-${ARCH}"; then
echo "No prebuild binary for ${OS}-${ARCH}."
exit 1
Expand Down
Loading