You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀 [Feature]: Module manifests now stamped with the resolved version at build time (#136)
Module manifests are now stamped with the resolved version and
prerelease tag at build time. The resulting artifact contains its final
`ModuleVersion` (and `PrivateData.PSData.Prerelease`) before tests run,
so the bytes that are tested are the bytes that ship.
- FixesPSModule/Process-PSModule#326
## Inputs on `Build-PSModule`
`Build-PSModule` now exposes new module-centric inputs:
| Input | Required | Description |
| --- | --- | --- |
| `Name` | No | Name of the module to build. Defaults to the repository
name. |
| `Version` | **Yes** | Module version (`Major.Minor.Patch`) to stamp
into the manifest. Build fails with a clear error when omitted or
malformed. |
| `Prerelease` | No | Prerelease tag (for example `mybranch001`) to
stamp into `PrivateData.PSData.Prerelease`. When empty, no prerelease
tag is written. |
| `OutputFolder` | No | Path (relative to `WorkingDirectory`) where the
built module is placed. Defaults to `outputs/module`. |
Typical usage downstream of
[`PSModule/Resolve-PSModuleVersion`](https://github.com/PSModule/Resolve-PSModuleVersion):
```yaml
- name: Build module
uses: PSModule/Build-PSModule@v5
with:
Version: ${{ steps.resolve.outputs.Version }}
Prerelease: ${{ steps.resolve.outputs.Prerelease }}
```
## Breaking changes
- `Version` is now **required**. Callers that previously omitted it
(relying on the `999.0.0` placeholder) must now pass an explicit version
in `Major.Minor.Patch` format. Builds fail immediately with a clear
error when `Version` is missing or malformed.
## Technical details
- `action.yml`: adds `OutputFolder` (default `outputs/module`),
`Version` (`required: true`), and `Prerelease` inputs; `Name` remains
optional and still defaults to the repository name.
- `src/main.ps1`: reads `OutputFolder`, `Version`, and `Prerelease` from
env; throws immediately when `Version` is missing or not in
`Major.Minor.Patch` format.
- `src/helpers/Build-PSModule.ps1`: `ModuleVersion` parameter is now
`[Parameter(Mandatory)]`.
- `src/helpers/Build/Build-PSModuleManifest.ps1`: `ModuleVersion` is
`[Parameter(Mandatory)]`; the `999.0.0` fallback is removed — the
version is assigned directly.
Related PRs:
- PSModule/Resolve-PSModuleVersion#1 — emits the `Version` and
`Prerelease` values consumed here.
- PSModule/Publish-PSModule#71 — drops its own version stamping; expects
the artifact to arrive pre-stamped.
- PSModule/Process-PSModule#342 — wires the workflow end-to-end.
0 commit comments