@@ -70,25 +70,36 @@ jobs:
7070 [ "$INC" = "patch" ] && INC=revision
7171 echo "inc=$INC" >> "$GITHUB_OUTPUT"
7272
73- # 5️⃣ Install NBGV CLI
73+ # 5️⃣ Install the NBGV CLI
7474 - name : 🔧 Install NBGV CLI
7575 run : dotnet tool install -g nbgv --version 3.8.38-alpha
7676
77- - name : ⚙️ Configure Git for commits
78- run : |
79- git config user.name "release-bot"
80- git config user.email "release-bot@users.noreply.github.com"
81-
82- # 6️⃣ Bump version and create the release branch
77+ # 6️⃣ Prepare the release branch with an explicit patch bump
8378 - name : 🛠️ Prepare release branch
8479 id : prep_release
8580 run : |
81+ set -euo pipefail
82+
83+ # Determine a prerelease tag only for non-main branches
8684 TAG_ARG=""
8785 if [[ "${{ inputs.target_branch }}" != "main" && "${{ inputs.target_branch }}" != "master" ]]; then
88- TAG_ARG="dev" # or whatever prerelease you want
86+ TAG_ARG="dev"
8987 fi
9088
91- nbgv prepare-release $TAG_ARG -p .
89+ # 1) Read the current SemVer2 (e.g. "1.0.0")
90+ CURRENT=$(nbgv get-version -v SemVer2)
91+
92+ # 2) Split and bump the patch segment
93+ IFS='.' read -r MAJ MIN PATCH <<< "$CURRENT"
94+ NEXT="$MAJ.$MIN.$((PATCH + 1))"
95+ echo "Calculated next version: $NEXT"
96+
97+ # 3) Call prepare-release with --nextVersion
98+ nbgv prepare-release $TAG_ARG \
99+ --nextVersion "$NEXT" \
100+ -p .
101+
102+ # 4) Expose the branch name for downstream jobs
92103 echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
93104
94105 # 7️⃣ Resolve the exact tag & SemVer2
0 commit comments