Skip to content

Commit a5d35ce

Browse files
committed
Release 0.1.4
1 parent 5a8fc9b commit a5d35ce

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<properties>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
32-
<revision>0.1.3</revision>
32+
<revision>0.1.4</revision>
3333
<maven.compiler.release>17</maven.compiler.release>
3434
<picocli.version>4.7.7</picocli.version>
3535
<javaparser.version>3.27.1</javaparser.version>

scripts/release-build.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2121
Options:
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-
4237
validate_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

7368
commit_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
107103
validate_version "$VERSION"
108104

109105
cd "$REPO_ROOT"
110-
ensure_clean_worktree
111106
[ "$(current_branch)" = "main" ] || die "Release script must be run from the main branch."
112107

113108
CURRENT_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

117111
ensure_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"

src/main/java/com/jaipilot/cli/JaiPilotVersionProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static String resolveVersion() {
1313
Package commandPackage = JaiPilotCli.class.getPackage();
1414
String version = commandPackage == null ? null : commandPackage.getImplementationVersion();
1515
if (version == null || version.isBlank()) {
16-
version = "0.1.3";
16+
version = "0.1.4";
1717
}
1818
return version;
1919
}

0 commit comments

Comments
 (0)