This GitHub Action is a part of the PSModule framework.
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.
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:
AutoPatchingIncrementalPrereleaseDatePrereleaseFormatVersionPrefixMajorLabels,MinorLabels,PatchLabels,IgnoreLabelsReleaseType
To migrate, run PSModule/Resolve-PSModuleVersion to compute
the version and pass it to 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).
- Downloads the
moduleartifact uploaded byBuild-PSModule. - Reads
ModuleVersionandPrivateData.PSData.Prereleasefrom the downloaded manifest. - Installs
RequiredModulesdeclared by the manifest. - Publishes the module to the PowerShell Gallery (
Publish-PSResource). - Creates a GitHub Release with the same tag.
- Zips the module folder and uploads it as a release asset (
<Name>-<Version>.zip). - Optionally cleans up prerelease tags whose name matches the current PR branch.
| 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 |