From 4872a5fc030b202411dee7b3d1a2fc4a315f732c Mon Sep 17 00:00:00 2001 From: Nadeesha Cabral Date: Sat, 30 Oct 2021 11:40:40 +0000 Subject: [PATCH] fix: Fetch next_ver before building --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 1a5f9d9..e6350b0 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,8 @@ package_name="cloudstate-cli" platforms=("windows/amd64" "windows/386" "darwin/amd64" "linux/amd64" "linux/386") +next_ver=$(npx semantic-release --dryRun | grep -oP 'Published release \K.*? ') + for platform in "${platforms[@]}" do platform_split=(${platform//\// }) @@ -14,9 +16,8 @@ do output_name+='.exe' fi - next_ver=$(npx semantic-release --dryRun | grep -oP 'Published release \K.*? ') - env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-s -w -X main.Version=$next_ver" -o bin/$output_name $package + if [ $? -ne 0 ]; then echo 'An error has occurred! Aborting the script execution...' exit 1