Skip to content

Commit

Permalink
Pass versions down in release script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexblackie committed Dec 24, 2021
1 parent 7046280 commit b0ffb76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion bin/build-releases
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b0ffb76

Please sign in to comment.