Skip to content

Commit 1a28443

Browse files
committed
CB-26218 Add linux arm64 build
1 parent b8613be commit 1a28443

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Makefile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BINARY=salt-bootstrap
22

3-
VERSION=0.13.6
3+
VERSION=0.13.7
44
BUILD_TIME=$(shell date +%FT%T)
55
LDFLAGS=-ldflags "-X github.com/hortonworks/salt-bootstrap/saltboot.Version=${VERSION} -X github.com/hortonworks/salt-bootstrap/saltboot.BuildTime=${BUILD_TIME}"
66
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./.git/*")
@@ -41,7 +41,7 @@ vet:
4141
test:
4242
go test -timeout 30s -coverprofile coverage -race $$(go list ./... | grep -v /vendor/)
4343

44-
_build: build-darwin build-linux build-ppc64le
44+
_build: build-darwin build-linux build-ppc64le build-linux-arm64
4545

4646
build: _check test _build
4747

@@ -50,16 +50,18 @@ build-docker:
5050
docker run --rm ${USER_NS} -v "${PWD}":/go/src/github.com/hortonworks/salt-bootstrap -w /go/src/github.com/hortonworks/salt-bootstrap -e VERSION=${VERSION} golang:1.14.3 make build
5151

5252
build-darwin:
53-
GOOS=darwin go build -a -installsuffix cgo ${LDFLAGS} -o build/Darwin/${BINARY} main.go
53+
GOOS=darwin go build -a -installsuffix cgo ${LDFLAGS} -o build/Darwin_x86_64/${BINARY} main.go
5454

5555
build-linux:
56-
GOOS=linux go build -a -installsuffix cgo ${LDFLAGS} -o build/Linux/${BINARY} main.go
56+
GOOS=linux go build -a -installsuffix cgo ${LDFLAGS} -o build/Linux_x86_64/${BINARY} main.go
57+
58+
build-linux-arm64:
59+
GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo ${LDFLAGS} -o build/Linux_arm64/${BINARY} main.go
5760

5861
build-ppc64le:
59-
GOOS=linux GOARCH=ppc64le go build -a -installsuffix cgo ${LDFLAGS} -o build/Linux-ppc64le/${BINARY} main.go
62+
GOOS=linux GOARCH=ppc64le go build -a -installsuffix cgo ${LDFLAGS} -o build/Linux_ppc64le/${BINARY} main.go
6063

6164
release: build-docker
62-
rm -rf release
6365
VERSION=${VERSION} BINARY=${BINARY} ./release.sh
6466

6567
docker_env_up:

release.sh

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ set -x
44
rm -rf release
55
mkdir release
66

7-
ARCH=$(uname -m)
8-
9-
declare -a Platforms=("Linux" "Darwin")
10-
for platform in ${Platforms[@]}; do
7+
declare -a Platforms=("Linux_x86_64" "Darwin_x86_64" "Linux_arm64")
8+
for platform in "${Platforms[@]}"; do
119
if [ -d "./build/$platform" ]; then
1210
echo "Compressing the ${platform} relevant binary ..."
13-
tar -zcf "release/${BINARY}_${VERSION}_${platform}_${ARCH}.tgz" -C build/$platform $BINARY
11+
tar -zcf "release/${BINARY}_${VERSION}_${platform}.tgz" -C build/$platform $BINARY
1412
fi
1513
done
1614

1715
echo "Creating release v${VERSION} from branch $BRANCH ..."
1816

1917
output=$(gh release list | grep ${VERSION})
2018
if [ -z "$output" ]; then
21-
gh release create "v${VERSION}" "./release/${BINARY}_${VERSION}_Linux_${ARCH}.tgz" "./release/${BINARY}_${VERSION}_Darwin_${ARCH}.tgz" -t ${VERSION} -n ""
19+
gh release create "v${VERSION}" ./release/*.tgz -t ${VERSION} -n ""
2220
else
2321
echo "The cli release ${VERSION} already exists on the github."
2422
fi

0 commit comments

Comments
 (0)