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

JingsongLi pushed a commit to branch release_paimon
in repository https://gitbox.apache.org/repos/asf/paimon-mosaic.git

commit c4eec65e039fed2a11d70b069fed3f6acce4145d
Author: JingsongLi <[email protected]>
AuthorDate: Thu May 21 13:36:11 2026 +0800

    Fix main-branch version bump to handle SNAPSHOT in pom.xml
    
    The update_branch_version.sh script now matches both exact and -SNAPSHOT
    suffixed versions in pom.xml, and strips -SNAPSHOT from NEW_VERSION for
    Cargo.toml/pyproject.toml (where SNAPSHOT is not a valid version format).
    The docs now document passing NEW_VERSION with -SNAPSHOT suffix so Java
    pom.xml correctly transitions to the next development version.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 docs/creating-a-release.html             |  6 +++---
 tools/releasing/update_branch_version.sh | 11 +++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/docs/creating-a-release.html b/docs/creating-a-release.html
index ad7250a..c3d06c7 100644
--- a/docs/creating-a-release.html
+++ b/docs/creating-a-release.html
@@ -163,11 +163,11 @@ RELEASE_VERSION=${RELEASE_VERSION} 
RELEASE_CANDIDATE=${RC_NUM} ./releasing/creat
             <p>This creates a branch named 
<code>release-${RELEASE_VERSION}-rc${RC_NUM}</code> from the current HEAD.</p>
 
             <h3>Bump Version on Main</h3>
-            <p>After cutting the release branch, bump <code>main</code> to the 
next version:</p>
+            <p>After cutting the release branch, bump <code>main</code> to the 
next development version:</p>
 <pre><code>git checkout main
 cd tools
-OLD_VERSION=${RELEASE_VERSION} NEW_VERSION=${NEXT_VERSION} 
./releasing/update_branch_version.sh</code></pre>
-            <p>The script updates version strings in all <code>pom.xml</code>, 
<code>Cargo.toml</code> (excluding <code>target/</code>), and 
<code>python/pyproject.toml</code> files, then creates a commit.</p>
+OLD_VERSION=${RELEASE_VERSION} NEW_VERSION=${NEXT_VERSION}-SNAPSHOT 
./releasing/update_branch_version.sh</code></pre>
+            <p>The script updates version strings in all <code>pom.xml</code> 
(matching both <code>${OLD_VERSION}</code> and 
<code>${OLD_VERSION}-SNAPSHOT</code>), <code>Cargo.toml</code> (excluding 
<code>target/</code>), and <code>python/pyproject.toml</code> files, then 
creates a commit.</p>
 
             <!-- ============================================================ 
-->
             <h2 id="build-a-release-candidate">Build a Release Candidate</h2>
diff --git a/tools/releasing/update_branch_version.sh 
b/tools/releasing/update_branch_version.sh
index 31e591f..03ec8a8 100755
--- a/tools/releasing/update_branch_version.sh
+++ b/tools/releasing/update_branch_version.sh
@@ -52,14 +52,17 @@ fi
 
 cd ..
 
-#change version in all pom files
-find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>'$OLD_VERSION'</version>#<version>'$NEW_VERSION'</version>#' {} \;
+# For Cargo.toml and pyproject.toml, strip any -SNAPSHOT suffix (not valid in 
those ecosystems)
+NEW_VERSION_CLEAN=$(echo "$NEW_VERSION" | sed 's/-SNAPSHOT//')
+
+#change version in all pom files (match both exact and -SNAPSHOT suffix)
+find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>'$OLD_VERSION'(-SNAPSHOT)?</version>#<version>'$NEW_VERSION'</version>#'
 {} \;
 
 #change version in Cargo.toml files
-find . -name 'Cargo.toml' -not -path '*/target/*' -type f -exec perl -pi -e 
's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION'"#' {} \;
+find . -name 'Cargo.toml' -not -path '*/target/*' -type f -exec perl -pi -e 
's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#' {} \;
 
 #change version in pyproject.toml
-perl -pi -e 's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION'"#' 
python/pyproject.toml
+perl -pi -e 's#^version = "'$OLD_VERSION'"#version = "'$NEW_VERSION_CLEAN'"#' 
python/pyproject.toml
 
 git commit -am "Update version to $NEW_VERSION"
 

Reply via email to