Skip to content

Commit 5bdf62c

Browse files
wuriyantowuriyanto
authored andcommitted
add build script for ARM64 chip
1 parent 9b03f7b commit 5bdf62c

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ build: build-ui
1010
build-osx: build-ui
1111
GOOS=darwin GOARCH=amd64 go build -ldflags '-s -w' -o tob github.com/telkomdev/tob/cmd/tob
1212

13+
# build for Apple's OSX 64 with Apple Chip
14+
build-osx-arm: build-ui
15+
GOOS=darwin GOARCH=arm64 go build -ldflags '-s -w' -o tob github.com/telkomdev/tob/cmd/tob
16+
1317
# build for Linux 64
1418
build-linux: build-ui
1519
GOOS=linux GOARCH=amd64 go build -ldflags '-s -w' -o tob github.com/telkomdev/tob/cmd/tob
@@ -24,6 +28,10 @@ build-win: build-ui
2428
build-http-agent-osx:
2529
GOOS=darwin GOARCH=amd64 go build -ldflags '-s -w' -o tob-http-agent github.com/telkomdev/tob/cmd/tob-http-agent
2630

31+
# build for Apple's OSX 64
32+
build-http-agent-osx-arm:
33+
GOOS=darwin GOARCH=arm64 go build -ldflags '-s -w' -o tob-http-agent github.com/telkomdev/tob/cmd/tob-http-agent
34+
2735
# build for Linux 64
2836
build-http-agent-linux:
2937
GOOS=linux GOARCH=amd64 go build -ldflags '-s -w' -o tob-http-agent github.com/telkomdev/tob/cmd/tob-http-agent

scripts/package.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ package()
2525
tar -czvf tob-${VERSION}.darwin-amd64.tar.gz tob
2626
rm tob
2727

28+
echo "packaging for Apple's OSX with Apple Chip"
29+
make build-osx-arm
30+
tar -czvf tob-${VERSION}.darwin-arm64.tar.gz tob
31+
rm tob
32+
2833
echo "packaging for Linux"
2934
make build-linux
3035
tar -czvf tob-${VERSION}.linux-amd64.tar.gz tob
@@ -43,10 +48,12 @@ package()
4348

4449
if [ "$OSNAME" = "linux" ]; then
4550
sha256sum tob-${VERSION}.darwin-amd64.tar.gz >> sha256sums.txt
51+
sha256sum tob-${VERSION}.darwin-arm64.tar.gz >> sha256sums.txt
4652
sha256sum tob-${VERSION}.linux-amd64.tar.gz >> sha256sums.txt
4753
sha256sum tob-${VERSION}.win-amd64.zip >> sha256sums.txt
4854
else
4955
shasum -a 256 tob-${VERSION}.darwin-amd64.tar.gz >> sha256sums.txt
56+
shasum -a 256 tob-${VERSION}.darwin-arm64.tar.gz >> sha256sums.txt
5057
shasum -a 256 tob-${VERSION}.linux-amd64.tar.gz >> sha256sums.txt
5158
shasum -a 256 tob-${VERSION}.win-amd64.zip >> sha256sums.txt
5259
fi

scripts/package_http_agent.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ package()
2525
tar -czvf tob-http-agent-${VERSION}.darwin-amd64.tar.gz tob-http-agent
2626
rm tob-http-agent
2727

28+
echo "packaging for Apple's OSX with Apple Chip"
29+
make build-http-agent-osx-arm
30+
tar -czvf tob-http-agent-${VERSION}.darwin-arm64.tar.gz tob-http-agent
31+
rm tob-http-agent
32+
2833
echo "packaging for Linux"
2934
make build-http-agent-linux
3035
tar -czvf tob-http-agent-${VERSION}.linux-amd64.tar.gz tob-http-agent
@@ -38,9 +43,11 @@ package()
3843

3944
if [ "$OSNAME" = "linux" ]; then
4045
sha256sum tob-http-agent-${VERSION}.darwin-amd64.tar.gz >> tob-http-agent-sha256sums.txt
46+
sha256sum tob-http-agent-${VERSION}.darwin-arm64.tar.gz >> tob-http-agent-sha256sums.txt
4147
sha256sum tob-http-agent-${VERSION}.linux-amd64.tar.gz >> tob-http-agent-sha256sums.txt
4248
else
4349
shasum -a 256 tob-http-agent-${VERSION}.darwin-amd64.tar.gz >> tob-http-agent-sha256sums.txt
50+
shasum -a 256 tob-http-agent-${VERSION}.darwin-arm64.tar.gz >> tob-http-agent-sha256sums.txt
4451
shasum -a 256 tob-http-agent-${VERSION}.linux-amd64.tar.gz >> tob-http-agent-sha256sums.txt
4552
fi
4653

0 commit comments

Comments
 (0)