1212 steps :
1313 - uses : actions/checkout@v4
1414
15+ - name : Install Dependencies
16+ shell : pwsh
17+ run : |
18+ if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
19+ Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Scope CurrentUser -Force
20+ }
21+ Set-PSRepository PSGallery -InstallationPolicy Trusted
22+ Install-Module PSScriptAnalyzer -Scope CurrentUser -RequiredVersion 1.22.0 -Force
23+ Install-Module Pester -Scope CurrentUser -RequiredVersion 5.7.1 -Force
24+ Install-Module posh-git -Scope CurrentUser -Force
25+ Install-Module git-aliases -Scope CurrentUser -Force
26+ Install-Module PowerShellGet -Scope CurrentUser -RequiredVersion 2.2.5 -Force
27+
28+ - name : Run Lint and Tests
29+ shell : pwsh
30+ run : |
31+ .\tools\ci.ps1
32+
1533 - name : Validate Module Version Against Tag
1634 if : startsWith(github.ref, 'refs/tags/v')
1735 shell : pwsh
@@ -22,14 +40,21 @@ jobs:
2240 throw "Manifest version '$($manifest.Version)' does not match tag version '$tagVersion'."
2341 }
2442
25- - name : Install PowerShellGet
43+ - name : Validate and Stage Release Notes
2644 shell : pwsh
2745 run : |
28- if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
29- Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Scope CurrentUser -Force
46+ $manifestPath = Resolve-Path -LiteralPath .\git-aliases-extra.psd1 |
47+ Select-Object -ExpandProperty Path -First 1
48+ $manifest = Test-ModuleManifest -Path $manifestPath -ErrorAction Stop
49+ $moduleVersion = $manifest.Version.ToString()
50+
51+ $releaseNotes = .\tools\get-release-notes.ps1 -Version $moduleVersion
52+ if (-not $releaseNotes) {
53+ throw "Release notes for version '$moduleVersion' are empty."
3054 }
31- Set-PSRepository PSGallery -InstallationPolicy Trusted
32- Install-Module PowerShellGet -Scope CurrentUser -Force
55+
56+ Update-ModuleManifest -Path $manifestPath -ReleaseNotes $releaseNotes
57+ Write-Host "Release notes for version '$moduleVersion' loaded from CHANGELOG.md."
3358
3459 - name : Publish to PSGallery
3560 shell : pwsh
0 commit comments