This is an automated email from the ASF dual-hosted git repository.

dashorst pushed a commit to branch wicket-9.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-9.x by this push:
     new eacc28b179 Fix the release script failures found while releasing 9.25.0
eacc28b179 is described below

commit eacc28b179118dc1a667b7bc87251795d951d524
Author: Martijn Dashorst <[email protected]>
AuthorDate: Mon Oct 26 18:37:43 2026 +0100

    Fix the release script failures found while releasing 9.25.0
    
    build-versions.py gave every module the release and development version
    of Wicket itself, so the experimental modules, which have a version line
    of their own (wicket-http2 and wicket-metrics), were set to the Wicket
    version and had to be corrected by hand in release.properties for
    9.25.0. A module with a version of its own is now released at that
    version without -SNAPSHOT and continues on the next one; a module that
    shares the project version keeps getting the versions from the command
    line.
    
    release.sh:
    
    - The tag signing passed the escaped quotes of its message to git as
      literal characters, failed with "too many arguments" and left the
      release tag unsigned. The quotes are plain now, and a failure stops
      the script.
    - gpg problems surfaced only in release:perform, after release:prepare
      had committed and tagged. The script now signs a test message before
      anything else, which also unlocks the key in the agent.
    - The default version was read before switching to wicket-9.x, so after
      a failed run it came from the build branch and suggested the next
      version. The script checks out wicket-9.x first.
    - The generated revert script lost the backslash of "-exec rm {} \;"
      and failed in find; it uses "-exec rm {} +" now.
    
    The staging repository id and the sequential uploads were fixed on this
    branch before.
    
    GitHub issue #1721
    
    Generated-by: Claude Code (Claude Opus 5.5)
---
 build-versions.py | 22 +++++++++++++++++-----
 release.sh        | 11 +++++++++--
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/build-versions.py b/build-versions.py
index d5a5e56df3..39dc91a7f0 100755
--- a/build-versions.py
+++ b/build-versions.py
@@ -9,7 +9,9 @@
 #     build-versions.py <release-version> <dev-version>
 #
 # This will generate a release.properties file that will release the
-# release-version, and will continue development on dev-version.
+# release-version, and will continue development on dev-version. A module
+# with a version of its own, such as the experimental modules, is released
+# at that version without -SNAPSHOT and continues on the next one.
 #
 # Example:
 #
@@ -32,19 +34,29 @@ devVersion = sys.argv[2]
 relVersions = []
 devVersions = []
 
-def addVersions(groupId, artifactId):
-    relVersions.append("project.rel." + groupId + "\\:" + artifactId + "=" + 
relVersion)
-    devVersions.append("project.dev." + groupId + "\\:" + artifactId + "=" + 
devVersion)
+def ownVersions(version):
+    release = version[:-len("-SNAPSHOT")] if version.endswith("-SNAPSHOT") 
else version
+    parts = release.split(".")
+    parts[-1] = str(int(parts[-1]) + 1)
+    return release, ".".join(parts) + "-SNAPSHOT"
+
+def addVersions(groupId, artifactId, version):
+    rel, dev = (relVersion, devVersion) if version == projectVersion else 
ownVersions(version)
+    relVersions.append("project.rel." + groupId + "\\:" + artifactId + "=" + 
rel)
+    devVersions.append("project.dev." + groupId + "\\:" + artifactId + "=" + 
dev)
 
 def addModule(directory):
     pom = ET.parse(os.path.join(directory, "pom.xml")).getroot()
 
     groupId = pom.findtext("pom:groupId", namespaces=NS) or 
pom.findtext("pom:parent/pom:groupId", namespaces=NS)
-    addVersions(groupId, pom.findtext("pom:artifactId", namespaces=NS))
+    version = pom.findtext("pom:version", namespaces=NS) or 
pom.findtext("pom:parent/pom:version", namespaces=NS)
+    addVersions(groupId, pom.findtext("pom:artifactId", namespaces=NS), 
version)
 
     for module in pom.iterfind(".//pom:modules/pom:module", NS):
         addModule(os.path.join(directory, module.text))
 
+projectVersion = ET.parse("pom.xml").getroot().findtext("pom:version", 
namespaces=NS)
+
 addModule(".")
 
 for version in relVersions:
diff --git a/release.sh b/release.sh
index e379a48c56..4a1e9b8c5e 100755
--- a/release.sh
+++ b/release.sh
@@ -126,7 +126,7 @@ svn rm 
https://dist.apache.org/repos/dist/dev/wicket/$version -m "Release vote h
 mvn org.sonatype.plugins:nexus-staging-maven-plugin:LATEST:rc-drop 
-DstagingRepositoryId=$stagingrepoid -DnexusUrl=https://repository.apache.org 
-DserverId=apache.releases.https -Ddescription="Release vote has failed"
 
 # clean up remaining release files
-find . -name "*.releaseBackup" -exec rm {} \\;
+find . -name "*.releaseBackup" -exec rm {} +
 [ -f release.properties ] && rm release.properties
 
 EOF
@@ -324,6 +324,12 @@ Java used to compile (from toolchain) is: 
$(getJdkToolchain)
 
 agentcount=`ps aux|grep gpg-agent|wc -l`
 
+echo "Checking that gpg can sign"
+echo "test" | gpg --clearsign > /dev/null || fail "gpg is unable to sign, 
check gpg-agent and pinentry"
+
+# the version to release comes from $GIT_BRANCH, not from a build branch left 
by a failed run
+git checkout $GIT_BRANCH || fail "Unable to check out $GIT_BRANCH"
+
 current_version=$(getProjectVersionFromPom)
 major_version=$(expr $current_version : '\(.*\)\..*\..*\-.*')
 minor_version=$(expr $current_version : '.*\.\(.*\)\..*\-.*')
@@ -621,7 +627,8 @@ git commit -m "Added post-release scripts and vote/release 
email templates"
 
 echo "Signing the release tag"
 git checkout $tag
-git tag --sign --force --message \"Signed release tag for Apache Wicket 
$version\" $tag >> $log
+git tag --sign --force --message "Signed release tag for Apache Wicket 
$version" $tag >> $log \
+    || fail "Unable to sign the release tag $tag"
 git checkout $branch
 
 echo "Pushing build artifacts to the staging repository"

Reply via email to