From 6a8f7f0a4002d61de6b509a28b7cb2d6176d5595 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 1 May 2023 18:08:03 +0200 Subject: [PATCH] add release script --- release.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 release.sh diff --git a/release.sh b/release.sh new file mode 100644 index 000000000..5d932efdd --- /dev/null +++ b/release.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Script to create a new release +# ------------------------------ + +# exit on error +set -e + +# make sure we're on master +BRANCH="$(git rev-parse --abbrev-ref HEAD)" +if [[ "$BRANCH" != "master" ]]; then + echo "You're on branch '$BRANCH', you should be on 'master'." + exit +fi + +# make sure README.md has been updated +read -r -p "Has README.md been updated? (Y/n) " CONFIRM +case "$CONFIRM" in +n | N) exit ;; +esac + +read -r -p "New version (x.y.z): " VERSION + +mvn versions:set -DgenerateBackupPoms=false -DnewVersion="$VERSION" +git add . +git commit -am "release $VERSION" +git tag "$VERSION" + +read -r -p "Push master and tag $VERSION? (y/N) " CONFIRM +case "$CONFIRM" in +y | Y) git push --atomic origin master "$VERSION" ;; +esac