-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.31 KB
/
Copy pathPublish-Module.yml
File metadata and controls
63 lines (57 loc) · 2.31 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
name: Publish-Module
on:
workflow_call:
secrets:
APIKey:
description: The API key for the PowerShell Gallery.
required: true
inputs:
Settings:
type: string
description: The complete settings object.
required: true
permissions:
contents: write # to checkout the repo, create releases, and upload release artifacts
pull-requests: write # to comment on PRs
jobs:
Publish-Module:
name: Publish-Module
runs-on: ubuntu-latest
env:
SETTINGS: ${{ inputs.Settings }}
steps:
- name: Checkout Code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Checkout Process-PSModule
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ job.workflow_repository }}
ref: ${{ job.workflow_sha }}
path: _wf
persist-credentials: false
- name: Publish module
if: fromJson(inputs.Settings).Publish.Module.Resolution.ReleaseType != 'None'
uses: ./_wf/.github/actions/Publish-PSModule
env:
GH_TOKEN: ${{ github.token }}
with:
Name: ${{ fromJson(inputs.Settings).Name }}
ModulePath: outputs/module
APIKey: ${{ secrets.APIKey }}
WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }}
UsePRTitleAsReleaseName: ${{ fromJson(inputs.Settings).Publish.Module.UsePRTitleAsReleaseName }}
UsePRBodyAsReleaseNotes: ${{ fromJson(inputs.Settings).Publish.Module.UsePRBodyAsReleaseNotes }}
UsePRTitleAsNotesHeading: ${{ fromJson(inputs.Settings).Publish.Module.UsePRTitleAsNotesHeading }}
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}
- name: Cleanup prereleases
if: fromJson(inputs.Settings).Publish.Module.Resolution.ReleaseType != 'Prerelease'
uses: ./_wf/.github/actions/Cleanup-PSModulePrereleases
env:
GH_TOKEN: ${{ github.token }}
with:
WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }}
AutoCleanup: ${{ fromJson(inputs.Settings).Publish.Module.AutoCleanup }}
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}