Skip to content

Commit d59f1fa

Browse files
Document separated publishing actions
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 034d5aa commit d59f1fa

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Publish-PSModule
2+
3+
Publishes a pre-versioned PowerShell module artifact to the PowerShell Gallery. GitHub Release creation is intentionally handled by the separate [Release-PSModule](../Release-PSModule/README.md) action.
4+
5+
## Inputs
6+
7+
| Name | Description | Required | Default |
8+
| --- | --- | --- | --- |
9+
| `Name` | Name of the module to publish. | No | Repository name |
10+
| `ModulePath` | Path containing the built `<Name>/` module directory. | No | `outputs/module` |
11+
| `ArtifactName` | Name of the module artifact to download. | No | `module` |
12+
| `APIKey` | PowerShell Gallery API key. | Yes | N/A |
13+
| `WhatIf` | Logs publishing operations without publishing the module. | No | `false` |
14+
| `WorkingDirectory` | Directory where the publishing script runs. | No | `.` |
15+
16+
## Outputs
17+
18+
This action does not provide outputs.
19+
20+
## Usage
21+
22+
```yaml
23+
- name: Publish module
24+
uses: ./.github/actions/Publish-PSModule
25+
with:
26+
Name: ExampleModule
27+
ModulePath: outputs/module
28+
ArtifactName: module
29+
APIKey: ${{ secrets.APIKEY }}
30+
```
31+
32+
Use [Release-PSModule](../Release-PSModule/README.md) in a separate workflow step to create the GitHub release from the same artifact.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Release-PSModule
2+
3+
Creates or resumes a GitHub release for a pre-versioned PowerShell module artifact. The action attaches the exact built module ZIP to the release and reports the result on the source pull request.
4+
5+
## Inputs
6+
7+
| Name | Description | Required | Default |
8+
| --- | --- | --- | --- |
9+
| `Name` | Name of the module to release. | No | Repository name |
10+
| `ModulePath` | Path containing the built `<Name>/` module directory. | No | `outputs/module` |
11+
| `ArtifactName` | Name of the module artifact to download. | No | `module` |
12+
| `ReleaseTag` | Full GitHub release tag resolved by `Resolve-PSModuleVersion`. | Yes | N/A |
13+
| `WhatIf` | Logs release operations without creating or uploading anything. | No | `false` |
14+
| `WorkingDirectory` | Directory where the release script runs. | No | `.` |
15+
| `UsePRTitleAsReleaseName` | Uses the pull request title as the release name. | No | `false` |
16+
| `UsePRBodyAsReleaseNotes` | Uses the pull request body as release notes. | No | `true` |
17+
| `UsePRTitleAsNotesHeading` | Adds the pull request title as an H1 release-notes heading. | No | `true` |
18+
19+
## Outputs
20+
21+
| Name | Description |
22+
| --- | --- |
23+
| `ReleaseTag` | Full GitHub release tag created or resumed by the action. |
24+
| `ReleaseUrl` | URL of the GitHub release created or resumed by the action. |
25+
26+
## Usage
27+
28+
Pass the Plan job's resolved `FullVersion` as `ReleaseTag` so the configured tag prefix is preserved.
29+
30+
```yaml
31+
- name: Create GitHub release
32+
id: create-github-release
33+
uses: ./.github/actions/Release-PSModule
34+
with:
35+
Name: ExampleModule
36+
ModulePath: outputs/module
37+
ArtifactName: module
38+
ReleaseTag: ${{ fromJson(inputs.Settings).Publish.Module.Resolution.FullVersion }}
39+
```
40+
41+
The action requires a `pull_request` event and a built module artifact. If a release already exists for `ReleaseTag`, it resumes by replacing the module ZIP, which makes retrying a partial release safe.

0 commit comments

Comments
 (0)