Skip to content

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 19 Jan 23:44
· 9 commits to main since this release
e1b338d

🚀 [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.

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:

  1. Initialize Publish Context (init.ps1) – Calculates version, validates inputs, and stores context in environment variables
  2. Publish Module (publish.ps1) – Downloads artifact, updates manifest, publishes to PSGallery, and creates GitHub release (runs only when ShouldPublish is true)
  3. Cleanup Prereleases (cleanup.ps1) – Deletes old prerelease tags (runs only when ShouldCleanup is 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.