-
Notifications
You must be signed in to change notification settings - Fork 0
🌟 [Major]: Version calculation removed — artifact must be pre-stamped before publish #71
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
Marius Storhaug (MariusStorhaug)
merged 22 commits into
main
from
feat/326-resolve-psmodule-version
May 27, 2026
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fedb9fd
BREAKING: remove version calculation; publish pre-stamped artifact an…
MariusStorhaug 3ca4e18
Address Copilot review: validate version format, gate cleanup on stab…
MariusStorhaug 239a98d
Fix CI failures: remove Test-ModuleManifest, fix lint warnings and ta…
MariusStorhaug 80d44ea
Use utf8NoBOM encoding when writing to GITHUB_ENV
MariusStorhaug 23ec483
fix: address review feedback on publish.ps1 and action.yml
MariusStorhaug f7417b6
chore: remove breaking change notes regarding version calculation fro…
MariusStorhaug a3a69a1
docs: update README.md to remove deprecated features and clarify usage
MariusStorhaug a7332bd
fix: add Test-ModuleManifest validation and prerelease regex guard
MariusStorhaug 06c7bfb
fix: filter cleanup on isPrerelease to avoid deleting stable releases
MariusStorhaug db7d200
fix: make Test-ModuleManifest non-terminating for missing RequiredMod…
MariusStorhaug 6f5b20f
fix: use Get-Content -Raw for JSON event parsing and fix long line
MariusStorhaug 43a6f99
fix: add UTF-8 BOM to publish.ps1 for PSUseBOMForUnicodeEncodedFile
MariusStorhaug 09152da
test: add version validation step to prove artifact is not stamped
MariusStorhaug 3d50e52
test: use pre-stamped version 1.2.3 in test artifact
MariusStorhaug 40ed488
test: add prerelease and unstamped version test cases
MariusStorhaug ff56835
fix: address unresolved PR review comments
MariusStorhaug 82d6969
fix: correct ModulePath in prerelease/unstamped tests, add placeholde…
MariusStorhaug 6b6ab0c
fix: unstamped fixture should have no ModuleVersion key, update valid…
MariusStorhaug 932e828
fix: simplify prerelease fixture manifest to remove non-existent file…
MariusStorhaug 042f31e
fix: address copilot review - path normalization, fixture manifests, …
MariusStorhaug 464fbbd
fix: use named parameters for Join-Path (PSAvoidUsingPositionalParame…
MariusStorhaug 012b38c
fix: use unique artifact names in test workflow and address review co…
MariusStorhaug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,52 @@ | ||
| # Publish-PSModule | ||
|
|
||
| This GitHub Action is a part of the [PSModule framework](https://github.com/PSModule). | ||
|
|
||
| It publishes a **pre-versioned** PowerShell module artifact to the PowerShell Gallery and creates a matching GitHub | ||
| Release. The compressed module is also uploaded as a release asset so the GitHub Release page exposes the exact bytes | ||
| that were tested and pushed to the Gallery. | ||
|
|
||
| ## Breaking change — v3.0.0 | ||
|
|
||
| `Publish-PSModule` no longer calculates the next version or mutates the module manifest. The artifact passed in must | ||
| already contain the final `ModuleVersion` (and `Prerelease` tag, if any). | ||
|
|
||
| The following inputs were **removed**: | ||
|
|
||
| - `AutoPatching` | ||
| - `IncrementalPrerelease` | ||
| - `DatePrereleaseFormat` | ||
| - `VersionPrefix` | ||
| - `MajorLabels`, `MinorLabels`, `PatchLabels`, `IgnoreLabels` | ||
| - `ReleaseType` | ||
|
|
||
| To migrate, run [`PSModule/Resolve-PSModuleVersion`](https://github.com/PSModule/Resolve-PSModuleVersion) to compute | ||
| the version and pass it to [`PSModule/Build-PSModule`](https://github.com/PSModule/Build-PSModule) so the artifact is | ||
| stamped before it is tested. The publish action then ships that artifact without any post-build manipulation. | ||
|
|
||
| This makes the tested artifact identical to the published artifact (see | ||
| [PSModule/Process-PSModule#326](https://github.com/PSModule/Process-PSModule/issues/326)). | ||
|
|
||
| ## What it does | ||
|
|
||
| 1. Downloads the `module` artifact uploaded by `Build-PSModule`. | ||
| 2. Reads `ModuleVersion` and `PrivateData.PSData.Prerelease` from the downloaded manifest. | ||
| 3. Installs `RequiredModules` declared by the manifest. | ||
| 4. Publishes the module to the PowerShell Gallery (`Publish-PSResource`). | ||
| 5. Creates a GitHub Release with the same tag. | ||
| 6. Zips the module folder and uploads it as a release asset (`<Name>-<Version>.zip`). | ||
| 7. Optionally cleans up prerelease tags whose name matches the current PR branch. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Required | Default | | ||
| | -------------------------- | ------------------------------------------------------------------------------------------ | -------- | ---------------- | | ||
| | `Name` | Name of the module. Defaults to the repository name. | No | Repository name | | ||
| | `ModulePath` | Path to the downloaded module folder. | No | `outputs/module` | | ||
| | `APIKey` | PowerShell Gallery API key. | Yes | | | ||
| | `AutoCleanup` | Delete prerelease tags matching the PR branch after a stable release. | No | `true` | | ||
| | `WhatIf` | Log the changes that would be made without publishing, creating, or deleting anything. | No | `false` | | ||
| | `WorkingDirectory` | The working directory where the script will run from. | No | `.` | | ||
| | `UsePRTitleAsReleaseName` | Use the PR title as the release name (otherwise the version string is used). | No | `false` | | ||
| | `UsePRBodyAsReleaseNotes` | Use the PR body as the release notes (otherwise `--generate-notes` is used). | No | `true` | | ||
| | `UsePRTitleAsNotesHeading` | Prefix the release notes with the PR title as an H1 heading linking to the PR. | No | `true` | | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.