File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ DRYRUN=$2
88
99BRANCH=$( git branch --show-current)
1010RELEASE_BRANCH=
11+ SKIP_RELEASE_CREATION=false
1112
1213BASE=$( ./gradlew printVersion -Psnapshot=false | grep ' Version:' | cut -f2 -d' ' )
1314# BASE == 0.0.1
@@ -52,7 +53,12 @@ if [ "$TYPE" == "MINOR" ] || [ "$TYPE" == "MAJOR" ]; then
5253 # BASE == 1.0.0
5354 fi
5455 RELEASE_BRANCH=" release/${BASE% .* } ._"
55- create_annotated_tag " $BASE " " $TYPE " " $BRANCH "
56+ if [ -z " $DRYRUN " ] && git rev-parse " v_${BASE} " > /dev/null 2>&1 ; then
57+ echo " Tag v_${BASE} already exists; skipping tag and release branch creation — will only produce a version-bump PR"
58+ SKIP_RELEASE_CREATION=true
59+ else
60+ create_annotated_tag " $BASE " " $TYPE " " $BRANCH "
61+ fi
5662fi
5763
5864if [ " $TYPE " == " PATCH" ]; then
@@ -106,7 +112,7 @@ if [ "$TYPE" == "RETAG" ]; then
106112 exit 0
107113fi
108114
109- if [ " $BRANCH " != " $RELEASE_BRANCH " ]; then
115+ if [ " $SKIP_RELEASE_CREATION " == " false " ] && [ " $ BRANCH" != " $RELEASE_BRANCH " ]; then
110116 git checkout -b $RELEASE_BRANCH
111117 if ! git diff --quiet; then
112118 git add build.gradle.kts
You can’t perform that action at this time.
0 commit comments