Skip to content

Commit

Permalink
Add ARM releases
Browse files Browse the repository at this point in the history
Signed-off-by: Xabier Larrakoetxea <[email protected]>
  • Loading branch information
slok committed Jul 25, 2019
1 parent ba164f2 commit 82491fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions hack/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,32 @@ src=./cmd/grafterm
out=./bin/grafterm

goarch=amd64
goos=linux
goarm=7

if [ $ostype == 'Linux' ]; then
if [ $ostype == 'Linux' ]; then
echo "Building linux release..."
goos=linux
binary_ext=-linux-amd64
elif [ $ostype == 'Darwin' ]; then
elif [ $ostype == 'Darwin' ]; then
echo "Building darwin release..."
goos=darwin
binary_ext=-darwin-amd64
elif [ $ostype == 'Windows' ]; then
elif [ $ostype == 'Windows' ]; then
echo "Building windows release..."
goos=windows
binary_ext=-windows-amd64.exe
elif [ $ostype == 'ARM64' ]; then
echo "Building ARM64 release..."
goos=linux
goarch=arm64
binary_ext=-linux-arm64
elif [ $ostype == 'ARM' ]; then
echo "Building ARM release..."
goos=linux
goarch=arm
goarm=7
binary_ext=-linux-arm-v7
else
echo "ostype env var required"
exit 1
Expand All @@ -30,4 +43,4 @@ ldf_cmp="-w -extldflags '-static'"
f_ver="-X main.Version=${VERSION:-dev}"

echo "Building binary at ${final_out}"
GOOS=${goos} GOARCH=${goarch} CGO_ENABLED=0 go build -o ${final_out} --ldflags "${ldf_cmp} ${f_ver}" ${src}
GOOS=${goos} GOARCH=${goarch} GOARM=${goarm} CGO_ENABLED=0 go build -o ${final_out} --ldflags "${ldf_cmp} ${f_ver}" ${src}
2 changes: 1 addition & 1 deletion hack/scripts/ci-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -n ${CIRCLE_TAG} ]]; then
echo "Tag ${CIRCLE_TAG}. building releases..."

archs=( Linux Darwin Windows )
archs=( Linux Darwin Windows ARM64 ARM )
for arch in "${archs[@]}"
do
VERSION=${CIRCLE_TAG} ostype=${arch} ${current_dir}/build.sh
Expand Down

0 comments on commit 82491fa

Please sign in to comment.