-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
76 lines (71 loc) · 3.4 KB
/
Copy pathaction.yml
File metadata and controls
76 lines (71 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish-PSModule
description: Publish a pre-versioned PowerShell module artifact to the PowerShell Gallery and GitHub Releases.
author: PSModule
inputs:
Name:
description: Name of the module to publish.
required: false
ModulePath:
description: Path to the folder containing the <Name>/ module subdirectory from Build-PSModule.
required: false
default: outputs/module
APIKey:
description: PowerShell Gallery API Key.
required: true
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
default: 'false'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: '.'
UsePRTitleAsReleaseName:
description: When enabled, uses the pull request title as the name for the GitHub release. If not set, the version string is used.
required: false
default: 'false'
UsePRBodyAsReleaseNotes:
description: When enabled, uses the pull request body as the release notes for the GitHub release. If not set, the release notes are auto-generated.
required: false
default: 'true'
UsePRTitleAsNotesHeading:
description: When enabled along with UsePRBodyAsReleaseNotes, the release notes will begin with the pull request title as a H1 heading followed by the pull request body. The title will reference the pull request number.
required: false
default: 'true'
ArtifactName:
description: Name of the uploaded artifact to download. Must match the name used in the upstream upload-artifact step.
required: false
default: module
VersionPrefix:
description: |
Prefix put in front of the version in the git tag of the GitHub release, for example 'v'.
Comes from Settings.Publish.Module.VersionPrefix, which the Plan job resolves. The compiled manifest carries the module version as
Major.Minor.Patch and cannot carry the prefix, so it is supplied here. An empty value tags the release without a prefix.
required: false
default: ''
runs:
using: composite
steps:
- name: Install-PSModule
uses: ./_wf/.github/actions/Install-PSModule
- name: Update Microsoft.PowerShell.PSResourceGet
shell: pwsh
run: Install-PSResource -Name Microsoft.PowerShell.PSResourceGet -Repository PSGallery -TrustRepository
- name: Download module artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.ArtifactName }}
path: ${{ inputs.ModulePath }}
- name: Publish Module
shell: pwsh
working-directory: ${{ inputs.WorkingDirectory }}
env:
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_WhatIf: ${{ inputs.WhatIf }}
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRBodyAsReleaseNotes: ${{ inputs.UsePRBodyAsReleaseNotes }}
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsReleaseName: ${{ inputs.UsePRTitleAsReleaseName }}
PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsNotesHeading: ${{ inputs.UsePRTitleAsNotesHeading }}
PSMODULE_PUBLISH_PSMODULE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
run: ${{ github.action_path }}/src/publish.ps1