Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DRYRUN=$2

BRANCH=$(git branch --show-current)
RELEASE_BRANCH=
SKIP_RELEASE_CREATION=false

BASE=$(./gradlew printVersion -Psnapshot=false | grep 'Version:' | cut -f2 -d' ')
# BASE == 0.0.1
Expand Down Expand Up @@ -52,7 +53,12 @@ if [ "$TYPE" == "MINOR" ] || [ "$TYPE" == "MAJOR" ]; then
# BASE == 1.0.0
fi
RELEASE_BRANCH="release/${BASE%.*}._"
create_annotated_tag "$BASE" "$TYPE" "$BRANCH"
if [ -z "$DRYRUN" ] && git rev-parse "v_${BASE}" >/dev/null 2>&1; then
echo "Tag v_${BASE} already exists; skipping tag and release branch creation — will only produce a version-bump PR"
SKIP_RELEASE_CREATION=true
Comment on lines +56 to +58
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep minor reruns consistent with validation

When a minor rerun starts from main still at the already-tagged version, the workflow validation computes the next release version (release-validated.yml lines 102-105) and the non-dry-run summary reports that validated tag/branch as successfully created (lines 216-220). This new branch instead exits the release-creation path as soon as the current tag exists, so the job can succeed after only opening the bump PR and without creating the validated release tag/branch, leaving operators with a false successful-release summary for the next version.

Useful? React with 👍 / 👎.

else
create_annotated_tag "$BASE" "$TYPE" "$BRANCH"
fi
fi

if [ "$TYPE" == "PATCH" ]; then
Expand Down Expand Up @@ -106,7 +112,7 @@ if [ "$TYPE" == "RETAG" ]; then
exit 0
fi

if [ "$BRANCH" != "$RELEASE_BRANCH" ]; then
if [ "$SKIP_RELEASE_CREATION" == "false" ] && [ "$BRANCH" != "$RELEASE_BRANCH" ]; then
git checkout -b $RELEASE_BRANCH
if ! git diff --quiet; then
git add build.gradle.kts
Expand Down
Loading