v6.1.0
🚀 [Feature]: Plan job decides version before build so tested artifact equals published artifact (#342)
The version a module ships with is now decided in a new Plan job that runs before the module is built. The same artifact then flows through tests and publish without being mutated, so the artifact you tested is the artifact that lands in the PowerShell Gallery and on the GitHub Release.
- Fixes #326
New: Plan job replaces Get-Settings
Get-Settings.yml is renamed to Plan.yml. The Plan job runs two steps in sequence and exposes everything downstream jobs need:
Get-PSModuleSettings— loads.github/PSModule.ymland emits the resolvedSettingsJSON.Resolve-PSModuleVersion— reads settings + PR labels, queries existing releases and the PowerShell Gallery, and emits the next version.
Plan job output: a single Settings JSON. The resolved version is merged into it as Settings.Module.{Version, Prerelease, FullVersion, ReleaseType, CreateRelease}, so every downstream job receives one self-contained object with no separate version outputs.
flowchart LR
A[Plan<br/>Get-PSModuleSettings + Resolve-PSModuleVersion] --> B[Build-Module<br/>stamps version into manifest]
B --> C[Test-* / Coverage]
C --> D[Publish-Module<br/>publishes artifact unchanged]Changed: Build-Module now stamps the real version
Build-Module.yml reads the version from Settings.Module.Version / Settings.Module.Prerelease and passes them to Build-PSModule. The built manifest contains the version the module will ship with before any test runs. The 999.0.0 placeholder only appears when no version is provided (for example, direct callers that bypass the Plan job).
Changed: Publish-Module no longer calculates or mutates versions
Publish-Module.yml drops every input that used to drive version calculation:
AutoPatchingDatePrereleaseFormatIgnoreLabelsIncrementalPrereleaseMajorLabels/MinorLabels/PatchLabelsReleaseTypeVersionPrefix
Publish-Module now reads the version straight from the manifest that arrived from Build-Module and pushes it to the PowerShell Gallery as-is. The PR-title / PR-body / heading inputs are unchanged. The job also gains permission to upload release assets so the zipped module can be attached to the GitHub Release.
Fixed: Tested artifact equals published artifact
The placeholder-then-rewrite flow is gone. The bytes tested in Test-Module / Test-ModuleLocal are the same bytes published to the PowerShell Gallery and attached to the GitHub Release.
Technical Details
Plan.yml(renamed fromGet-Settings.yml): adds aResolve-Versionstep (runs unconditionally — it computes the release decision, includingReleaseType) followed by anEnrich-Settingsstep that merges the resolved version intoSettings.Module.*. Plan exposes a singleSettingsoutput on both the job andworkflow_call.workflow.yml: theGet-Settingsjob is renamed toPlanand every downstreamneeds:/with:reference is repointed. Downstream jobs consume the singleneeds.Plan.outputs.Settingsobject (version available underSettings.Module.*).Build-Module.yml: readsSettings.Module.Version/Settings.Module.Prereleaseand passes them asVersion/PrereleasetoBuild-PSModule, falling back to the999.0.0placeholder when a direct caller bypasses Plan and omitsSettings.Module.Publish-Module.yml: removes the seven version-calculation inputs and grantscontents: writepermission for release-asset uploads.README.md: replaces theGet-Settingssection with aPlansection that documents both steps and the artifact-integrity guarantee, and notes the new release-asset upload.PSModule/Build-PSModulepinned to@v5.0.0(SHA672aaa7a91a379c4c6cd14494d03ab5e87e13c52).PSModule/Publish-PSModulepinned to@v3.0.0(SHA03c0f8b53d0367c85a0f121f98af9b40c817b0e3).
Companion repos
| Repo | Change | Link |
|---|---|---|
PSModule/Resolve-PSModuleVersion |
New action — v1.1.0 released | https://github.com/PSModule/Resolve-PSModuleVersion/releases/tag/v1.1.0 |
PSModule/Build-PSModule |
Major — adds Version / Prerelease inputs — v5.0.0 released |
https://github.com/PSModule/Build-PSModule/releases/tag/v5.0.0 |
PSModule/Publish-PSModule |
Major / BREAKING — drops version calculation, publishes pre-stamped artifact, uploads module zip to release — v3.0.0 released | https://github.com/PSModule/Publish-PSModule/releases/tag/v3.0.0 |
Implementation plan progress
- Rename
Get-Settingsjob toPlanand addResolve-PSModuleVersionstep - Expose a single
Settingsoutput (resolved version merged intoSettings.Module.{Version, Prerelease, FullVersion, ReleaseType, CreateRelease}) - Update
Build-Module.ymlto read the version fromSettings.Module.*and stamp it - Strip version-calculation inputs from
Publish-Module.yml - Update
needs/withwiring acrossworkflow.yml - Update
README.md(Plan section + release-asset note) -
Resolve-PSModuleVersionaction implementation (v1.1.0 released) -
Build-PSModuleVersion/Prereleaseinputs (v5.0.0 released) -
Publish-PSModulev3 release (v3.0.0 released — PSModule/Publish-PSModule#71) - Repin
@mainreferences inBuild-Module.ymlandPublish-Module.ymlto released SHAs - End-to-end run on a labeled PR
Notes
- The public input/output contract of
workflow.ymlis unchanged for external consumers — this is internal wiring. - #339 covered the same scope and was closed; this PR restarts the work cleanly off the current
main.