Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: include Darwin ARM64 build #13

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

maxdanilov
Copy link
Contributor

@maxdanilov maxdanilov commented Oct 25, 2024

Currently we're only building for Darwin AMD64 (x64), but the default architecture for recent Macbooks is ARM64.
This PR includes a new binary to be built for ARM64 architecture (binary name zbctl.darwin-arm64). The AMD64 flavor will be built as zbctl.darwin-amd64.


Tested by running locally:

./cmd/zbctl/build.sh

+ OS=(linux windows darwin darwin)
+ ARCH=(amd64 amd64 amd64 arm64)
+ BINARY=(zbctl zbctl.exe zbctl.darwin-amd64 zbctl.darwin-arm64)
++ dirname ./cmd/zbctl/build.sh
+ SRC_DIR=./cmd/zbctl
+ DIST_DIR=./cmd/zbctl/dist
+ VERSION=development
++ git rev-parse HEAD
+ COMMIT=173f92a824dfa6508a6311d98a00c579b9f9690b
+ mkdir -p ./cmd/zbctl/dist
+ rm -rf ./cmd/zbctl/dist/zbctl ./cmd/zbctl/dist/zbctl.darwin-amd64 ./cmd/zbctl/dist/zbctl.darwin-arm64 ./cmd/zbctl/dist/zbctl.exe
+ for i in '"${!OS[@]}"'
+ '[' 0 -eq 0 ']'
+ for i in '"${!OS[@]}"'
+ '[' 0 -eq 0 ']'
+ CGO_ENABLED=0
+ GOOS=linux
+ GOARCH=amd64
+ go build -a -tags netgo -ldflags '-w -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Version=development -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Commit=173f92a824dfa6508a6311d98a00c579b9f9690b' -o ./cmd/zbctl/dist/zbctl ./cmd/zbctl/main.go
+ for i in '"${!OS[@]}"'
+ '[' 0 -eq 0 ']'
+ CGO_ENABLED=0
+ GOOS=windows
+ GOARCH=amd64
+ go build -a -tags netgo -ldflags '-w -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Version=development -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Commit=173f92a824dfa6508a6311d98a00c579b9f9690b' -o ./cmd/zbctl/dist/zbctl.exe ./cmd/zbctl/main.go
+ for i in '"${!OS[@]}"'
+ '[' 0 -eq 0 ']'
+ CGO_ENABLED=0
+ GOOS=darwin
+ GOARCH=amd64
+ go build -a -tags netgo -ldflags '-w -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Version=development -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Commit=173f92a824dfa6508a6311d98a00c579b9f9690b' -o ./cmd/zbctl/dist/zbctl.darwin-amd64 ./cmd/zbctl/main.go
+ wait
+ CGO_ENABLED=0
+ GOOS=darwin
+ GOARCH=arm64
+ go build -a -tags netgo -ldflags '-w -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Version=development -X github.com/camunda-community-hub/zeebe-client-go/v8/cmd/zbctl/internal/commands.Commit=173f92a824dfa6508a6311d98a00c579b9f9690b' -o ./cmd/zbctl/dist/zbctl.darwin-arm64 ./cmd/zbctl/main.go

result:

ls -l cmd/zbctl/dist
total 103776
-rwxr-xr-x  1 maxim.danilov  staff  13182711 Oct 25 21:14 zbctl
-rwxr-xr-x  1 maxim.danilov  staff  13373408 Oct 25 21:14 zbctl.darwin-amd64
-rwxr-xr-x  1 maxim.danilov  staff  13020274 Oct 25 21:14 zbctl.darwin-arm64
-rwxr-xr-x  1 maxim.danilov  staff  13550592 Oct 25 21:14 zbctl.exe

@maxdanilov maxdanilov self-assigned this Oct 25, 2024
@maxdanilov maxdanilov requested a review from megglos October 25, 2024 19:18
Copy link
Collaborator

@megglos megglos left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@megglos megglos merged commit 3258105 into main Nov 5, 2024
5 checks passed
@maxdanilov maxdanilov deleted the add-build-darwin-arm64 branch November 5, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants