Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): only increase patch version on final releases #508

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
15 changes: 12 additions & 3 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,18 @@ jobs:
git checkout main && git merge -X theirs releases --no-commit --no-ff

# Extract release version
IFS=. read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH<<<"${{ env.RELEASE_VERSION }}"
# Compute new snapshot version
VERSION="$RELEASE_VERSION_MAJOR.$RELEASE_VERSION_MINOR.$((RELEASE_VERSION_PATCH+1))-SNAPSHOT"
IFS=.- read -r RELEASE_VERSION_MAJOR RELEASE_VERSION_MINOR RELEASE_VERSION_PATCH SNAPSHOT<<<"${{ env.RELEASE_VERSION }}"
INC=0
# Compute new snapshot version, do not increment snapshot on non-final releases, e.g. -rc1
if [ -z $SNAPSHOT ]; then
# snapshot
echo "${{ env.RELEASE_VERSION }} is a final release version, increase patch for next snapshot"
INC=1
else
echo "${{ env.RELEASE_VERSION }} is not a final release version (contains \"$SNAPSHOT\"), will not increase patch"
fi

VERSION="$RELEASE_VERSION_MAJOR.$RELEASE_VERSION_MINOR.$((RELEASE_VERSION_PATCH+$INC))-SNAPSHOT"
SNAPSHOT_VERSION=$VERSION

# Persist the "version" in the gradle.properties
Expand Down