@@ -16,7 +16,7 @@ Prepares a new JAIPilot release by:
1616 1. Updating the project version.
1717 2. Running the full Maven verify build.
1818 3. Smoke-testing the install script for that version.
19- 4. Creating a release commit and annotated git tag.
19+ 4. Creating a release commit (including current worktree changes) and annotated git tag.
2020
2121Options:
2222 --version <version> Release version such as 0.3.2.
@@ -34,11 +34,6 @@ require_command() {
3434 command -v " $1 " > /dev/null 2>&1 || die " Required command not found: $1 "
3535}
3636
37- ensure_clean_worktree () {
38- git diff --quiet --ignore-submodules HEAD -- || die " Git worktree is not clean."
39- git diff --cached --quiet --ignore-submodules -- || die " Git index has staged changes."
40- }
41-
4237validate_version () {
4338 printf ' %s' " $1 " | grep -Eq ' ^[0-9]+\.[0-9]+\.[0-9]+$' || die " Version must look like 0.3.2"
4439}
@@ -72,7 +67,8 @@ ensure_tag_absent() {
7267
7368commit_and_tag () {
7469 version=$1
75- git add " $POM_FILE " " $VERSION_PROVIDER_FILE "
70+ git add -A
71+ git diff --cached --quiet --ignore-submodules -- && die " No changes to commit for release $version ."
7672 git commit -m " Release $version "
7773 git tag -a " v$version " -m " Release $version "
7874}
@@ -107,17 +103,17 @@ require_command grep
107103validate_version " $VERSION "
108104
109105cd " $REPO_ROOT "
110- ensure_clean_worktree
111106[ " $( current_branch) " = " main" ] || die " Release script must be run from the main branch."
112107
113108CURRENT_VERSION=$( current_version)
114109[ -n " $CURRENT_VERSION " ] || die " Could not determine the current project version."
115- [ " $CURRENT_VERSION " != " $VERSION " ] || die " Project is already at version $VERSION "
116110
117111ensure_tag_absent " v$VERSION "
118112
119- update_versions " $VERSION "
120- ensure_version_applied " $VERSION "
113+ if [ " $CURRENT_VERSION " != " $VERSION " ] || ! grep -Fq " version = \" $VERSION \" ;" " $VERSION_PROVIDER_FILE " ; then
114+ update_versions " $VERSION "
115+ ensure_version_applied " $VERSION "
116+ fi
121117
122118./mvnw -B verify
123119./scripts/smoke-test-install.sh --version " $VERSION "
0 commit comments