Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
ci(release): build release notes from CHANGELOG; auto-populate PSData.ReleaseNotes; harden version expansion#31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
341f921
ci(release): build release notes from CHANGELOG and harden version ex…
tablackburn aadfaea
ci(release): populate PSData.ReleaseNotes from CHANGELOG at publish time
tablackburn f4607e8
ci(release): guard empty changelog notes and unreadable CHANGELOG (re…
tablackburn 1ba3532
ci(release): exclude current tag from compare-link base (review)
tablackburn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -45,5 +45,50 @@ Task -Name 'Init_Integration' -Description 'Load integration test environment va | ||
| } | ||
| } | ||
| # Populate the built manifest's ReleaseNotes from the matching CHANGELOG.md entry so the | ||
| # PowerShell Gallery release-notes panel shows the curated, user-facing notes (the same | ||
| # content used for the GitHub release) instead of just a link. Depends on Build so the | ||
| # staged manifest in ModuleOutDir exists; runs before Publish (see $PSBPublishDependency | ||
| # below). Non-fatal if the changelog can't be read or has no entry for the version being | ||
| # published, so a release is never blocked. | ||
| Task -Name 'UpdateReleaseNotes' -Depends 'Build' -Description 'Set built manifest ReleaseNotes from the matching CHANGELOG.md entry' { | ||
| $changelogPath = Join-Path -Path $PSScriptRoot -ChildPath 'CHANGELOG.md' | ||
| if (-not (Test-Path -Path $changelogPath)) { | ||
| Write-Warning 'CHANGELOG.md not found; leaving ReleaseNotes unchanged.' | ||
| return | ||
| } | ||
| $moduleVersion = $PSBPreference.General.ModuleVersion | ||
| try { | ||
| Import-Module -Name 'ChangelogManagement' -ErrorAction Stop | ||
| $changelogData = Get-ChangelogData -Path $changelogPath -ErrorAction Stop | ||
| } | ||
| catch { | ||
| Write-Warning "Could not read CHANGELOG.md ($($_.Exception.Message)); leaving ReleaseNotes unchanged." | ||
| return | ||
| } | ||
| $releaseEntry = $changelogData.Released | | ||
| Where-Object { [string]$_.Version -eq [string]$moduleVersion } | | ||
| Select-Object -First 1 | ||
| if (-not $releaseEntry) { | ||
| Write-Warning "No CHANGELOG.md entry found for version $moduleVersion; leaving ReleaseNotes unchanged." | ||
| return | ||
| } | ||
| $releaseNotes = $releaseEntry.RawData.Trim() | ||
tablackburn marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if ([string]::IsNullOrWhiteSpace($releaseNotes)) { | ||
| Write-Warning "CHANGELOG.md entry for version $moduleVersion is empty; leaving ReleaseNotes unchanged." | ||
| return | ||
| } | ||
| $builtManifest = Join-Path -Path $PSBPreference.Build.ModuleOutDir -ChildPath "$($PSBPreference.General.ModuleName).psd1" | ||
| Update-ModuleManifest -Path $builtManifest -ReleaseNotes $releaseNotes -ErrorAction Stop | ||
| Write-Host " Set ReleaseNotes on built manifest from CHANGELOG [$($releaseEntry.Version)] ($($releaseNotes.Length) chars)" -ForegroundColor Gray | ||
| } | ||
| # Inject ReleaseNotes into the built manifest before publishing (PowerShellBuild's Publish | ||
| # defaults to depending only on 'Test'). | ||
| $PSBPublishDependency = @('Test', 'UpdateReleaseNotes') | ||
| # Note: -Depends replaces PowerShellBuild's default dependencies, so we must include Pester and Analyze explicitly | ||
| Task -Name 'Test' -FromModule 'PowerShellBuild' -MinimumVersion '0.7.3' -Depends 'Init_Integration', 'Pester', 'Analyze' | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.