@@ -13,10 +13,12 @@ build-osx:
13
13
ifneq ($(shell uname -s) ,Darwin)
14
14
$(error this makefile assumes you're building from mac env)
15
15
endif
16
- GO111MODULE=on CGO_ENABLED=0 $(GOCMD) build -o bin/$(BINARY_NAME)-$(shell $(GOCMD) run . --version | cut -d" " -f 3)-osx .
16
+ GOARCH=amd64 GO111MODULE=on CGO_ENABLED=0 $(GOCMD) build -o bin/$(BINARY_NAME)-$(shell $(GOCMD) run . --version | cut -d" " -f 3)-osx-x86_64 .
17
+ GOARCH=arm64 GO111MODULE=on CGO_ENABLED=0 $(GOCMD) build -o bin/$(BINARY_NAME)-$(shell $(GOCMD) run . --version | cut -d" " -f 3)-osx-arm64 .
17
18
18
19
build-linux :
19
- docker run --rm -v $(shell pwd) :/app -w /app golang:1.22-alpine /bin/sh -c " GO111MODULE=on CGO_ENABLED=0 $( GOCMD) build -o bin/$( BINARY_NAME) -$( shell $( GOCMD) run . --version | cut -d" " -f 3) -linux ."
20
+ docker run --rm -v $(shell pwd) :/app -w /app golang:1.22-alpine /bin/sh -c " GOARCH=amd64 GO111MODULE=on CGO_ENABLED=0 $( GOCMD) build -o bin/$( BINARY_NAME) -$( shell $( GOCMD) run . --version | cut -d" " -f 3) -linux-x86_64 ."
21
+ docker run --rm -v $(shell pwd) :/app -w /app golang:1.22-alpine /bin/sh -c " GOARCH=arm64 GO111MODULE=on CGO_ENABLED=0 $( GOCMD) build -o bin/$( BINARY_NAME) -$( shell $( GOCMD) run . --version | cut -d" " -f 3) -linux-aarch64 ."
20
22
21
23
clean :
22
24
rm -rf ./bin
@@ -32,10 +34,12 @@ test:
32
34
33
35
verify-binaries :
34
36
$(info running binaries verification on osx, alpine, debiand, centos)
35
- ./bin/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -osx --version
36
- docker run --rm -v $(shell pwd) /bin:/app -w /app alpine /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux --version
37
- docker run --rm -v $(shell pwd) /bin:/app -w /app debian:buster /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux --version
38
- docker run --rm -v $(shell pwd) /bin:/app -w /app centos:8 /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux --version
37
+ ./bin/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -osx-x86_64 --version
38
+ ./bin/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -osx-arm64 --version
39
+ docker run --rm -v $(shell pwd) /bin:/app -w /app alpine /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux-aarch64 --version
40
+ docker run --rm -v $(shell pwd) /bin:/app -w /app alpine /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux-x86_64 --version
41
+ docker run --rm -v $(shell pwd) /bin:/app -w /app debian:buster /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux-aarch64 --version
42
+ docker run --rm -v $(shell pwd) /bin:/app -w /app debian:buster /app/$(BINARY_NAME ) -$(shell $(GOCMD ) run . --version | cut -d" " -f 3) -linux-x86_64 --version
39
43
40
44
compress-bin :
41
45
find bin -type f -print -exec zip -j ' {}' .zip ' {}' \;
0 commit comments