Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7fe9b76
WorkspaceDirectory
MariusStorhaug Feb 27, 2025
09c7f02
📝 [Docs]: Add `WorkingDirectory` setting to README
MariusStorhaug Feb 27, 2025
b4697a3
🩹 [Refactor]: Replace Write-Verbose with Write-Host for clearer conso…
MariusStorhaug Feb 27, 2025
97a4917
🩹 [Refactor]: Add new configuration and settings files, remove obsole…
MariusStorhaug Feb 27, 2025
9cc6dd1
🩹 [Enhancement]: Add detailed logging of input parameters for module …
MariusStorhaug Feb 27, 2025
73579d7
🩹 [Fix]: Update WorkingDirectory input to use GitHub workspace path f…
MariusStorhaug Feb 28, 2025
3bc26e4
🩹 [Fix]: Update WorkingDirectory input to use GitHub workspace path f…
MariusStorhaug Feb 28, 2025
123328b
🩹 [Enhancement]: Refactor Resolve-PSModuleDependency to support Insta…
MariusStorhaug Feb 28, 2025
3a67413
🩹 [Refactor]: Move Convert-VersionSpec function to a separate script …
MariusStorhaug Feb 28, 2025
43de48d
🩹 [Fix]: Remove GitHub workspace path from WorkingDirectory input for…
MariusStorhaug Feb 28, 2025
21decfc
Fix PSModule/Process-PSModule/issues/82
MariusStorhaug Feb 28, 2025
91ba6bd
🩹 [Fix]: Convert output of Format-List to string for improved logging…
MariusStorhaug Mar 2, 2025
a3d6774
🩹 [Enhancement]: Add Install-PSModuleHelpers step and remove obsolete…
MariusStorhaug Mar 5, 2025
5b05980
🩹 [Fix]: Update WorkingDirectory default value to '.' for consistency…
MariusStorhaug Mar 6, 2025
dff8f9e
🩹 [Fix]: Remove GITHUB_TOKEN environment variable from Auto-Release w…
MariusStorhaug Mar 8, 2025
efd9ed1
🩹 [Fix]: Convert PSGallery version to string for improved output form…
MariusStorhaug Mar 10, 2025
aa9220c
🩹 [Fix]: Initialize $latest variable to null before fetching the late…
MariusStorhaug Mar 13, 2025
9d39b3a
🩹 [Fix]: Remove redundant initialization of $latest variable in Publi…
MariusStorhaug Mar 13, 2025
f896bd2
🩹 [Fix]: Improve error handling when fetching the latest module versi…
MariusStorhaug Mar 13, 2025
24aff89
🩹 [Fix]: Update output formatting for GitHub version and manifest ver…
MariusStorhaug Mar 13, 2025
3e9d57f
🩹 [Fix]: Correctly convert the latest version to string format in Pub…
MariusStorhaug Mar 13, 2025
48ab209
🩹 [Fix]: Enhance null check for latest module version in Publish-PSMo…
MariusStorhaug Mar 13, 2025
6e305a8
🩹 [Fix]: Simplify version check for latest module in Publish-PSModule…
MariusStorhaug Mar 13, 2025
a0004a0
🩹 [Fix]: Refactor retry logic for fetching latest module version in P…
MariusStorhaug Mar 13, 2025
5086efe
[Fix]: Ensure proper string interpolation for output of latest module…
MariusStorhaug Mar 13, 2025
a59d827
🩹 [Fix]: Remove unnecessary throw statement in error handling for mod…
MariusStorhaug Mar 13, 2025
e2f081e
[Refactor]: Remove ConfigurationFile input and update action script p…
MariusStorhaug Mar 23, 2025
e61617f
Remove config file way of using Publish-PSModule (expecting only Proc…
MariusStorhaug Mar 23, 2025
ae417b1
[Refactor]: Update README and action.yml to streamline input paramete…
MariusStorhaug Mar 24, 2025
ff1fb42
[Fix]: Correctly assign DatePrereleaseFormat variable in Publish-PSMo…
MariusStorhaug Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
Verbose: true
Debug: true
Name: PSModuleTest
ModulePath: tests/outputs/modules
WorkingDirectory: tests
APIKey: ${{ secrets.APIKEY }}
WhatIf: true
2 changes: 0 additions & 2 deletions .github/workflows/Auto-Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ jobs:

- name: Auto-Release
uses: PSModule/Auto-Release@v1
env:
GITHUB_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication
with:
IncrementalPrerelease: false
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ prerelease with the branch name (in normalized form) as the prerelease name. By
- `fix`

The types of labels used for the types of prereleases can be configured using the `MajorLabels`, `MinorLabels` and `PatchLabels`
parameters/settings in the configuration file. See the [Usage](#usage) section for more information.
parameters/settings. See the [Usage](#usage) section for more information.

When a pull request is merged into the default branch, the action will create a release based on the labels and clean up any previous
prereleases that was created.
Expand All @@ -47,38 +47,24 @@ The action can be configured using the following settings:

| Name | Description | Required | Default |
| --- | --- | --- | --- |
| `Name` | Name of the module to publish. Defaults to the repository name. | `false` | |
| `ModulePath` | Path to the folder where the module to publish is located. | `false` | `outputs/modules` |
| `APIKey` | PowerShell Gallery API Key. | `true` | |
| `AutoCleanup`| Control wether to automatically cleanup prereleases. If disabled, the action will not remove any prereleases. | `false` | `true` |
| `AutoPatching` | Control wether to automatically handle patches. If disabled, the action will only create a patch release if the pull request has a 'patch' label. | `false` | `true` |
| `ConfigurationFile` | The path to the configuration file. Settings in the configuration file take precedence over the action inputs. | `false` | `.github\auto-release.yml` |
| `DatePrereleaseFormat` | The format to use for the prerelease number using [.NET DateTime format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings). | `false` | `''` |
| `IgnoreLabels` | A comma separated list of labels that do not trigger a release. | `false` | `NoRelease` |
| `IncrementalPrerelease` | Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch. | `false` | `true` |
| `VersionPrefix` | The prefix to use for the version number. | `false` | `v` |
| `MajorLabels` | A comma separated list of labels that trigger a major release. | `false` | `major, breaking` |
| `MinorLabels` | A comma separated list of labels that trigger a minor release. | `false` | `minor, feature` |
| `ModulePath` | Path to the folder where the module to publish is located. | `false` | `outputs/modules` |
| `Name` | Name of the module to publish. Defaults to the repository name. | `false` | |
| `PatchLabels` | A comma separated list of labels that trigger a patch release. | `false` | `patch, fix` |
| `VersionPrefix` | The prefix to use for the version number. | `false` | `v` |
| `IgnoreLabels` | A comma separated list of labels that do not trigger a release. | `false` | `NoRelease` |
| `WhatIf` | Control wether to simulate the action. If enabled, the action will not create any releases. Used for testing. | `false` | `false` |
| `Debug` | Enable debug output. | `'false'` | `false` |
| `Verbose` | Enable verbose output. | `'false'` | `false` |
| `Version` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | | `false` |
| `Prerelease` | Allow prerelease versions if available. | `'false'` | `false` |

### Configuration file

The configuration file is a YAML file that can be used to configure the action.
By default, the configuration file is expected at `.github\auto-release.yml`, which can be changed using the `ConfigurationFile` setting.
The actions configuration can be change by altering the settings in the configuration file.

```yaml
DatePrereleaseFormat: 'yyyyMMddHHmm'
IncrementalPrerelease: false
VersionPrefix: ''
```

This example uses the date format for the prerelease, disables the incremental prerelease and removes the version prefix.
| `WorkingDirectory` | The working directory where the script runs. | `'false'` | `'.'` |

## Example

Expand Down
65 changes: 34 additions & 31 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
ModulePath:
description: Path to the module to publish.
required: false
default: outputs/modules
default: outputs/module
APIKey:
description: PowerShell Gallery API Key.
required: true
Expand All @@ -24,22 +24,18 @@ inputs:
description: Control wether to automatically handle patches. If disabled, the action will only create a patch release if the pull request has a 'patch' label.
required: false
default: 'true'
ConfigurationFile:
description: The path to the configuration file. Settings in the configuration file take precedence over the action inputs.
IncrementalPrerelease:
description: Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch.
required: false
default: .github\auto-release.yml
default: 'true'
DatePrereleaseFormat:
description: If specified, uses a date based prerelease scheme. The format should be a valid .NET format string like 'yyyyMMddHHmm'.
required: false
default: ''
IgnoreLabels:
description: A comma separated list of labels that do not trigger a release.
required: false
default: NoRelease
IncrementalPrerelease:
description: Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch.
VersionPrefix:
description: The prefix to use for the version number.
required: false
default: 'true'
default: v
MajorLabels:
description: A comma separated list of labels that trigger a major release.
required: false
Expand All @@ -52,10 +48,10 @@ inputs:
description: A comma separated list of labels that trigger a patch release.
required: false
default: patch, fix
VersionPrefix:
description: The prefix to use for the version number.
IgnoreLabels:
description: A comma separated list of labels that do not trigger a release.
required: false
default: v
default: NoRelease
WhatIf:
description: If specified, the action will only log the changes it would make, but will not actually create or delete any releases or tags.
required: false
Expand All @@ -75,32 +71,39 @@ inputs:
description: Allow prerelease versions if available.
required: false
default: 'false'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: '.'

runs:
using: composite
steps:
- name: Install-PSModuleHelpers
uses: PSModule/Install-PSModuleHelpers@v1

- name: Run Publish-PSModule
uses: PSModule/GitHub-Script@v1
env:
GITHUB_ACTION_INPUT_Name: ${{ inputs.Name }}
GITHUB_ACTION_INPUT_ModulePath: ${{ inputs.ModulePath }}
GITHUB_ACTION_INPUT_APIKey: ${{ inputs.APIKey }}
GITHUB_ACTION_INPUT_AutoCleanup: ${{ inputs.AutoCleanup }}
GITHUB_ACTION_INPUT_AutoPatching: ${{ inputs.AutoPatching }}
GITHUB_ACTION_INPUT_ConfigurationFile: ${{ inputs.ConfigurationFile }}
GITHUB_ACTION_INPUT_DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
GITHUB_ACTION_INPUT_IgnoreLabels: ${{ inputs.IgnoreLabels }}
GITHUB_ACTION_INPUT_IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
GITHUB_ACTION_INPUT_MajorLabels: ${{ inputs.MajorLabels }}
GITHUB_ACTION_INPUT_MinorLabels: ${{ inputs.MinorLabels }}
GITHUB_ACTION_INPUT_PatchLabels: ${{ inputs.PatchLabels }}
GITHUB_ACTION_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
GITHUB_ACTION_INPUT_WhatIf: ${{ inputs.WhatIf }}
PSMODULE_PUBLISH_PSMODULE_INPUT_Name: ${{ inputs.Name }}
PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath: ${{ inputs.ModulePath }}
PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey: ${{ inputs.APIKey }}
PSMODULE_PUBLISH_PSMODULE_INPUT_AutoCleanup: ${{ inputs.AutoCleanup }}
PSMODULE_PUBLISH_PSMODULE_INPUT_AutoPatching: ${{ inputs.AutoPatching }}
PSMODULE_PUBLISH_PSMODULE_INPUT_DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
PSMODULE_PUBLISH_PSMODULE_INPUT_IgnoreLabels: ${{ inputs.IgnoreLabels }}
PSMODULE_PUBLISH_PSMODULE_INPUT_IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
PSMODULE_PUBLISH_PSMODULE_INPUT_MajorLabels: ${{ inputs.MajorLabels }}
PSMODULE_PUBLISH_PSMODULE_INPUT_MinorLabels: ${{ inputs.MinorLabels }}
PSMODULE_PUBLISH_PSMODULE_INPUT_PatchLabels: ${{ inputs.PatchLabels }}
PSMODULE_PUBLISH_PSMODULE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }}
PSMODULE_PUBLISH_PSMODULE_INPUT_WorkingDirectory: ${{ inputs.WorkingDirectory }}
with:
Name: Publish-PSModule
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
Script: |
# Publish-PSModule
${{ github.action_path }}\scripts\main.ps1
WorkingDirectory: ${{ inputs.WorkingDirectory }}
Script: ${{ github.action_path }}/scripts/main.ps1
Loading
Loading