From ce49d99a9a30a6d80d1288468de8052c857911e2 Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Wed, 22 Feb 2023 19:48:31 +0100 Subject: [PATCH] Add Linux/arm32 builds Fixes #122 Or actually works around rather than fixes. The fix would be to have moar packaged for Debian. --- build.sh | 8 ++++---- release.sh | 1 + test.sh | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index ca33cc3..b304a32 100755 --- a/build.sh +++ b/build.sh @@ -8,12 +8,12 @@ fi VERSION="$(git describe --tags --dirty --always)" BINARY="moar" -if [ -n "$GOOS$GOARCH" ]; then +if [ -n "${GOOS}${GOARCH}" ]; then EXE="" - if [ "$GOOS" = "windows" ]; then + if [ "${GOOS}" = "windows" ]; then EXE=".exe" fi - BINARY="releases/$BINARY-$VERSION-$GOOS-$GOARCH$EXE" + BINARY="releases/${BINARY}-${VERSION}-${GOOS}-${GOARCH}${EXE}" fi # Linker flags version number trick below from here: @@ -25,4 +25,4 @@ fi # This line must be last in the script so that its return code # propagates properly to its caller -go build -ldflags="-s -w -X main.versionString=$VERSION" -o "$BINARY" +go build -ldflags="-s -w -X main.versionString=${VERSION}" -o "${BINARY}" diff --git a/release.sh b/release.sh index b05ba8f..46c4279 100755 --- a/release.sh +++ b/release.sh @@ -48,6 +48,7 @@ git tag --annotate "${VERSION}" # # NOTE: Make sure this list matches the one in test.sh GOOS=linux GOARCH=386 ./build.sh +GOOS=linux GOARCH=arm ./build.sh # Ref: https://github.com/walles/moar/issues/122 GOOS=darwin GOARCH=amd64 ./build.sh GOOS=windows GOARCH=amd64 ./build.sh diff --git a/test.sh b/test.sh index a6d3c10..d166878 100755 --- a/test.sh +++ b/test.sh @@ -26,6 +26,11 @@ go test -timeout 20s ./... echo "Testing cross compilation..." echo " Linux i386..." GOOS=linux GOARCH=386 ./build.sh + +# Ref: https://github.com/walles/moar/issues/122 +echo " Linux ARM32..." +GOOS=linux GOARCH=arm ./build.sh + echo " macOS amd64..." GOOS=darwin GOARCH=amd64 ./build.sh echo " Windows amd64..."