From b0ffb766930531e812f652cdaf01711669bfb334 Mon Sep 17 00:00:00 2001 From: Alex Blackie Date: Thu, 23 Dec 2021 20:28:49 -0800 Subject: [PATCH] Pass versions down in release script We should version the binaries in the release scripts, and ensure we pass the version from the toplevel release script down to the other scripts. --- bin/build-releases | 9 ++++++++- bin/release | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/build-releases b/bin/build-releases index 0a474ca..6ea70e6 100755 --- a/bin/build-releases +++ b/bin/build-releases @@ -18,12 +18,19 @@ TARGET_ARCH=( "amd64" ) +VERSION="${1:-}" + +if [ "$VERSION" = "" ] ; then + echo "You must specify a version number as the first argument." + exit 1 +fi + main() { mkdir -p release for OS in "${TARGET_OS[@]}" ; do for ARCH in "${TARGET_ARCH[@]}" ; do - CGO_ENABLED=0 GOOS="$OS" GOARCH="$ARCH" go build -o "release/apexredirector-$OS-$ARCH" . + CGO_ENABLED=0 GOOS="$OS" GOARCH="$ARCH" go build -o "release/apexredirector-$VERSION-$OS-$ARCH" . done done } diff --git a/bin/release b/bin/release index 5a5cad1..c1760f4 100755 --- a/bin/release +++ b/bin/release @@ -20,8 +20,8 @@ if [ "$VERSION" = "" ] ; then fi main() { - bin/build-releases - bin/publish-container + bin/build-releases "$VERSION" + bin/publish-container "$VERSION" git tag "$VERSION" git push --tags }