v2.2.0
🚀 [Feature]: Add ReleaseType input for explicit release control (#59)
The action now supports explicit control over the release type through the new ReleaseType input parameter. You can specify whether to create a stable release, prerelease, or skip releasing entirely—without relying on automatic detection from PR state and labels. The workflow has also been restructured into three phases (initialization, publishing, cleanup) that run conditionally, improving efficiency when only cleanup is needed.
- Part of PSModule/Process-PSModule#73
- Fixes PSModule/Process-PSModule#265
New ReleaseType input parameter
A new ReleaseType input allows you to explicitly control the release behavior:
| Value | Description |
|---|---|
Release |
Create a stable release (default) |
Prerelease |
Create a prerelease |
None |
Do not create any release |
This input is designed to work with Get-PSModuleSettings, which pre-calculates the appropriate release type based on your workflow context:
- uses: PSModule/Publish-PSModule@v2
with:
APIKey: ${{ secrets.PSGALLERY_API_KEY }}
ReleaseType: ${{ fromJson(inputs.Settings).Publish.Module.ReleaseType }}
AutoCleanup: ${{ fromJson(inputs.Settings).Publish.Module.AutoCleanup }}Restructured workflow execution
The action now runs in three separate phases, each executing only when needed:
- Initialize Publish Context (
init.ps1) – Calculates version, validates inputs, and stores context in environment variables - Publish Module (
publish.ps1) – Downloads artifact, updates manifest, publishes to PSGallery, and creates GitHub release (runs only whenShouldPublishis true) - Cleanup Prereleases (
cleanup.ps1) – Deletes old prerelease tags (runs only whenShouldCleanupis true)
This separation means the action skips unnecessary steps. For example, when a PR is closed without merging, the workflow can run cleanup independently without downloading artifacts or attempting to publish.
Backward compatibility
The ReleaseType parameter defaults to Release, maintaining current behavior for merged PRs targeting the default branch. Existing workflows continue to work without modification.