Skip to content

Commit

Permalink
fix: Fetch next_ver before building
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha authored Oct 30, 2021
1 parent 0945dad commit 4872a5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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//\// })
Expand All @@ -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
Expand Down

0 comments on commit 4872a5f

Please sign in to comment.