diff --git a/release.sh b/release.sh index f8783f7d0..5ff67e96b 100755 --- a/release.sh +++ b/release.sh @@ -6,11 +6,20 @@ set -euo pipefail # It will create a tag and push it, which will trigger CI to create a release, # build release binaries, push them to the release, and publish a new version on NPM +# Fail if we are not on trunk +BRANCH=$(git branch --show-current) +if [ "${BRANCH}" != "master" ]; then + echo "Please checkout master branch" + exit 1; +fi +git pull + NEW_TAG=$(./scripts/get-version) # Fail if the new tag already exists +# Note: exit status of the command is the conditional if git rev-parse "${NEW_TAG}" >/dev/null 2>&1; then - echo "Tag '${NEW_TAG}' already exists, please bump the version in package.yaml"; + echo "Tag '${NEW_TAG}' already exists, please bump the version in spago.cabal"; exit 1; fi @@ -20,4 +29,4 @@ git tag "${NEW_TAG}" git push origin "${NEW_TAG}" -echo "Done." \ No newline at end of file +echo "Done."