-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
53 lines (48 loc) · 1.84 KB
/
Copy pathaction.yml
File metadata and controls
53 lines (48 loc) · 1.84 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
name: Publish-PSModule
description: Publish a pre-versioned PowerShell module artifact to the PowerShell Gallery.
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 publish the module.
required: false
default: 'false'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: '.'
ArtifactName:
description: Name of the uploaded artifact to download. Must match the name used in the upstream upload-artifact step.
required: false
default: module
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 }}
run: ${{ github.action_path }}/src/publish.ps1