Skip to content

Commit e58ab14

Browse files
committed
ci: adopt GitReleaseNoteGenerator and nbgv CLI tool
- Replace the glennawatson/ChangeLog action with the GitReleaseNoteGenerator global tool (git-release-notes) to produce release notes, matching the reactiveui pipeline. Resolves #1093. - Swap the stale dotnet/nbgv JS action for the nbgv global tool, stamping cloud variables via `nbgv cloud -a` and exposing SemVer2/PrereleaseVersion as step outputs. - Keep Nerdbank.GitVersioning (version.json) as the version source; all branch/version policy checks are unchanged.
1 parent efc077c commit e58ab14

2 files changed

Lines changed: 35 additions & 16 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,20 @@ jobs:
3737
**/global.json
3838
**/nuget.config
3939
40-
- name: NBGV
40+
- name: Install (or update) nbgv tool
41+
run: dotnet tool update --global nbgv
42+
43+
- name: Set NBGV cloud variables
44+
run: nbgv cloud -a
45+
46+
- name: Expose NBGV version as step outputs
4147
id: nbgv
42-
uses: dotnet/nbgv@v0.5.2
43-
with:
44-
setAllVars: true
45-
48+
shell: pwsh
49+
run: |
50+
$ErrorActionPreference = 'Stop'
51+
"SemVer2=$env:NBGV_SemVer2" >> $env:GITHUB_OUTPUT
52+
"PrereleaseVersion=$env:NBGV_PrereleaseVersion" >> $env:GITHUB_OUTPUT
53+
4654
- name: NuGet Restore
4755
run: dotnet restore DynamicData.sln
4856
working-directory: src

.github/workflows/release.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ jobs:
5656
**/global.json
5757
**/nuget.config
5858
59-
- name: NBGV
59+
- name: Install (or update) nbgv tool
60+
run: dotnet tool update --global nbgv
61+
62+
- name: Set NBGV cloud variables
63+
run: nbgv cloud -a
64+
65+
- name: Expose NBGV version as step outputs
6066
id: nbgv
61-
uses: dotnet/nbgv@v0.5.2
62-
with:
63-
setAllVars: true
67+
shell: pwsh
68+
run: |
69+
$ErrorActionPreference = 'Stop'
70+
"SemVer2=$env:NBGV_SemVer2" >> $env:GITHUB_OUTPUT
71+
"PrereleaseVersion=$env:NBGV_PrereleaseVersion" >> $env:GITHUB_OUTPUT
6472
6573
- name: Verify version matches branch policy
6674
shell: pwsh
@@ -126,21 +134,24 @@ jobs:
126134
if ($LASTEXITCODE -ne 0) { throw "dotnet nuget push failed for $($pkg.Name) (exit $LASTEXITCODE)." }
127135
}
128136
129-
- name: Changelog
130-
uses: glennawatson/ChangeLog@0464dd89b26f61fecf24b41d675f8ffdb11c4c3f # v1
131-
id: changelog
137+
- name: Install GitReleaseNoteGenerator
138+
run: dotnet tool install -g GitReleaseNoteGenerator
139+
140+
- name: Generate release notes
141+
env:
142+
GITHUB_TOKEN: ${{ github.token }}
143+
RELEASE_VERSION: ${{ steps.nbgv.outputs.SemVer2 }}
144+
shell: pwsh
145+
run: git-release-notes --release-version "$env:RELEASE_VERSION" --output-file release-notes.md
132146

133147
- name: Create GitHub Release
134148
env:
135149
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136150
TAG: ${{ steps.nbgv.outputs.SemVer2 }}
137151
IS_PRERELEASE: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }}
138-
BODY: ${{ steps.changelog.outputs.commitLog }}
139152
shell: pwsh
140153
run: |
141154
$ErrorActionPreference = 'Stop'
142-
$notesPath = Join-Path $env:RUNNER_TEMP 'release-notes.md'
143-
Set-Content -Path $notesPath -Value $env:BODY -Encoding utf8 -NoNewline
144-
$cmd = @('release', 'create', $env:TAG, '--title', $env:TAG, '--notes-file', $notesPath, '--target', $env:GITHUB_SHA)
155+
$cmd = @('release', 'create', $env:TAG, '--title', $env:TAG, '--notes-file', 'release-notes.md', '--target', $env:GITHUB_SHA)
145156
if ($env:IS_PRERELEASE -eq 'true') { $cmd += '--prerelease' }
146157
gh @cmd

0 commit comments

Comments
 (0)