From cc6c846f0f57ad5a32132ff802cb901a5cbdbbc4 Mon Sep 17 00:00:00 2001 From: Hossain Khan Date: Mon, 20 Oct 2025 18:11:31 -0400 Subject: [PATCH] fix: update version script to increment minor version instead of patch - Changed version suggestion logic to always increment minor version - Patch version is now reset to 0 in suggestions - Example: 2.1.0 -> 2.2.0 or 2.1.3 -> 2.2.0 - Added clear comments explaining the version increment logic --- scripts/show_version_info.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/show_version_info.sh b/scripts/show_version_info.sh index 76df503..e8e3bd4 100755 --- a/scripts/show_version_info.sh +++ b/scripts/show_version_info.sh @@ -1,5 +1,9 @@ #!/bin/bash # Script to display current version information across the project +# https://semver.org/spec/v2.0.0.html +# +# 📚 Read following for additional context: +# - https://github.com/usetrmnl/trmnl-android/blob/main/RELEASE_CHECKLIST.md set -e @@ -48,10 +52,16 @@ else fi # Suggest next version +# Increment version code by 1 NEXT_VERSION_CODE=$((VERSION_CODE + 1)) -# Simple semantic version increment (assumes X.Y.Z format) + +# Increment minor version and reset patch version to 0 (assumes X.Y.Z format) +# Example: 2.1.0 -> 2.2.0, or 2.1.3 -> 2.2.0 IFS='.' read -ra VER_PARTS <<< "$VERSION_NAME" -NEXT_VERSION_NAME="${VER_PARTS[0]}.${VER_PARTS[1]}.$((${VER_PARTS[2]} + 1))" +MAJOR="${VER_PARTS[0]}" +MINOR="${VER_PARTS[1]}" +NEXT_MINOR=$((MINOR + 1)) +NEXT_VERSION_NAME="${MAJOR}.${NEXT_MINOR}.0" echo "🚀 Suggested next version:" echo " - Version Code: $NEXT_VERSION_CODE"