Commit 641a1e6
ci(release): build release notes from CHANGELOG; auto-populate PSData.ReleaseNotes; harden version expansion (#31)
* ci(release): build release notes from CHANGELOG and harden version expansion
Ports the ScheduledTasksManager release-tooling improvements into the template so
every module scaffolded from it inherits them.
- Create GitHub Release: extract the published version's section from CHANGELOG.md
and pass it via --notes-file (in pwsh), instead of --generate-notes. The latter
lists every merged PR since the last release tag, which between version bumps is
dominated by bot/CI/chore PRs and buries the actual user-facing changes. Includes
a Full Changelog compare link and falls back to --generate-notes if a version has
no changelog section (so a release is never blocked).
- Pass the version output via env (VERSION) in the 'Check if Release Exists',
'Check if PSGallery Version Exists', and 'Create GitHub Release' steps instead of
inlining ${{ steps.version.outputs.version }} into the run scripts. Inline
template expansion is substituted into the script text before the shell runs (a
template-injection vector zizmor/CodeRabbit flag); env vars are read at runtime.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(release): populate PSData.ReleaseNotes from CHANGELOG at publish time
So a scaffolded module's PowerShell Gallery release-notes panel shows the curated,
user-facing notes for each version (matching the GitHub release body) instead of a
static CHANGELOG link.
- build.depend.psd1: add ChangelogManagement 3.1.0 (Keep a Changelog parser).
- build.psake.ps1: new UpdateReleaseNotes task (Depends Build) that reads the entry
matching the module version via Get-ChangelogData and sets the built manifest's
PrivateData.PSData.ReleaseNotes via Update-ModuleManifest. Wired in via
$PSBPublishDependency so it runs before Publish-PSBuildModule. Non-fatal if the
changelog can't be read or has no entry for the version.
Mirrors the DSC Community Sampler pattern. Scaffolded modules use SemVer Keep a
Changelog (CHANGELOG.template.md), the format this was validated against in
ScheduledTasksManager. The template repo itself never runs this path (its publish
is guarded against the un-initialized placeholder).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(release): guard empty changelog notes and unreadable CHANGELOG (review)
Addresses Copilot review on #31:
- UpdateReleaseNotes: if the matched CHANGELOG entry is empty/whitespace, warn and
leave ReleaseNotes unchanged rather than overwriting the built manifest with an
empty string.
- Create GitHub Release: read CHANGELOG.md defensively (Test-Path + try/catch). A
missing or unreadable file now falls back to --generate-notes instead of failing
the publish (GitHub's pwsh runs with $ErrorActionPreference = 'Stop').
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(release): exclude current tag from compare-link base (review)
Addresses CodeRabbit review on #31: if a v$version tag already exists (e.g. a
re-run, or a tag pushed without a release), the previous-tag selection could pick
it and produce a self-referential Full Changelog compare link. Filter out
"v$version" before selecting the most recent tag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ec17dd4 commit 641a1e6
3 files changed
Lines changed: 108 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | | - | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
95 | 145 | | |
96 | 146 | | |
97 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
48 | 93 | | |
49 | 94 | | |
0 commit comments