Skip to content

Commit

Permalink
Merge pull request #1364 from mreiferson/dist-updates
Browse files Browse the repository at this point in the history
*: arm64 builds
  • Loading branch information
mreiferson authored Aug 15, 2021
2 parents fbe961c + 073967f commit 948669c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ rm -rf $DIR/dist/docker
mkdir -p $DIR/dist/docker

GOFLAGS='-ldflags="-s -w"'
arch=$(go env GOARCH)
version=$(awk '/const Binary/ {print $NF}' < $DIR/internal/version/binary.go | sed 's/"//g')
goversion=$(go version | awk '{print $3}')

echo "... running tests"
./test.sh

export GO111MODULE=on
for os in linux darwin freebsd windows; do
for target in "linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "freebsd/amd64" "windows/amd64"; do
os=${target%/*}
arch=${target##*/}
echo "... building v$version for $os/$arch"
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/nsq-XXXXX)
TARGET="nsq-$version.$os-$arch.$goversion"
Expand All @@ -42,11 +43,11 @@ for os in linux darwin freebsd windows; do
sudo rm -r $BUILD
done

docker buildx create --name nsq
docker buildx use nsq
rnd=$(LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c10)
docker buildx create --use --name nsq-$rnd
docker buildx build --tag nsqio/nsq:v$version . --platform linux/amd64,linux/arm64 --push
if [[ ! $version == *"-"* ]]; then
echo "Tagging nsqio/nsq:v$version as the latest release."
docker buildx build --tag nsqio/nsq:latest . --platform linux/amd64,linux/arm64 --push
fi
docker buildx rm nsq
docker buildx rm nsq-$rnd

0 comments on commit 948669c

Please sign in to comment.