CI: fix 32 bit ARM builds

This commit is contained in:
Maurizio Porrato 2021-05-16 09:01:14 +01:00
parent 6df602fa6b
commit d5c2b07e49
Signed by: guru
GPG Key ID: C622977DF024AC24
1 changed files with 3 additions and 1 deletions

View File

@ -31,20 +31,22 @@ go-build:
stage: build
script: |
for platform in $PLATFORMS ; do
echo "BUILDING $platform"
IFS="/" read GOOS GOARCH <<< "$platform"
case $GOARCH in
armv*)
GOARM=$(tr -cd "0-9" <<< $GOARCH)
GOARCH=arm
SUFFIX="$GOOS-${GOARCH}v$GOARM"
export GOARM
;;
*)
SUFFIX="$GOOS-$GOARCH"
unset GOARM
;;
esac
export GOOS GOARCH
for bin in $CMDS ; do
echo "BUILDING $bin for $platform"
go build -ldflags="-s -w" -trimpath -o bin/$bin-$SUFFIX ./cmd/$bin
done
done