3939 runs-on : ubuntu-latest
4040
4141 outputs :
42- release_branch : ${{ steps.nbgv .outputs.BranchName }}
43- tag : ${{ steps.version.outputs.tag }}
44- semver : ${{ steps.version.outputs.semver }}
42+ release_branch : ${{ steps.prep_release .outputs.branch }}
43+ tag : ${{ steps.version.outputs.tag }}
44+ semver : ${{ steps.version.outputs.semver }}
4545
4646 steps :
4747 # 1️⃣ Checkout the target branch / tag
@@ -70,21 +70,22 @@ jobs:
7070 [ "$INC" = "patch" ] && INC=revision
7171 echo "inc=$INC" >> "$GITHUB_OUTPUT"
7272
73- # 5️⃣ Bump version and create the release branch
74- - name : 🛠️ Bump version & create branch
75- id : nbgv
76- uses : dotnet/nbgv@v0.4.2
77- with :
78- toolVersion : 3.8.38-alpha
79- versionIncrement : ${{ steps.map.outputs.inc }} # ← dynamic now
80- firstUnstableTag : dev
81- versionFile : ${{ inputs.version_file_path }}
82- setCommonVars : true
83-
84- # 6️⃣ Install CLI once so we can query it
73+ # 5️⃣ Install NBGV CLI once
8574 - name : 🔧 Install NBGV CLI
8675 run : dotnet tool install -g nbgv --version 3.8.38-alpha
8776
77+ # 6️⃣ Bump version and create the release branch
78+ - name : 🛠️ Prepare release branch
79+ id : prep_release
80+ run : |
81+ nbgv prepare-release \
82+ --versionIncrement ${{ steps.map.outputs.inc }} \
83+ --firstUnstableTag dev \
84+ --versionFile "${{ inputs.version_file_path }}"
85+
86+ # expose the branch name for the Pack workflow
87+ echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
88+
8889 # 7️⃣ Resolve the exact tag & SemVer2
8990 - name : 🔖 Resolve tag & SemVer
9091 id : version
@@ -102,12 +103,24 @@ jobs:
102103 git push origin 0.0.0
103104 fi
104105
105- # 9️⃣ Build & upload release- notes.md (now in normal tag-diff mode)
106+ # 9️⃣ Generate release notes ( normal tag-diff mode)
106107 - name : 📝 Generate release notes
107108 id : changelog
108109 uses : mikepenz/release-changelog-builder-action@v5
109110 env :
110111 GITHUB_TOKEN : ${{ secrets.GH_TOKEN || github.token }}
111112
113+ # 🔒 Always create & upload the notes so the Pack job can grab them
112114 - name : 💾 Save notes to file
113- run : echo "${{ steps.changelog.outputs.changelog }}" > release-notes.md
115+ if : always()
116+ run : |
117+ CONTENT="${{ steps.changelog.outputs.changelog || '# Initial release' }}"
118+ echo "$CONTENT" > release-notes.md
119+ ls -l release-notes.md
120+
121+ - name : 📦 Upload release notes artifact
122+ if : always()
123+ uses : actions/upload-artifact@v4
124+ with :
125+ name : release_notes
126+ path : release-notes.md
0 commit comments