-
-
Notifications
You must be signed in to change notification settings - Fork 73
69 lines (62 loc) · 1.67 KB
/
publish-module.yml
File metadata and controls
69 lines (62 loc) · 1.67 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
name: 'Publish module'
on:
push:
branches:
- main
tags:
- "v*.*"
paths-ignore:
- '**'
workflow_run:
workflows: ["update-module.yml"]
types:
- completed
branches:
- main
workflow_dispatch:
# on:
# push:
# branches:
# - main
# tags:
# - "v*.*"
# paths-ignore:
# - '**'
permissions:
contents: read
jobs:
publish-module:
runs-on: ubuntu-latest
#if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v6
- name: Install and cache PowerShell modules
id: psmodulecache
uses: potatoqualitee/psmodulecache@v6.2.1
with:
modules-to-cache: PowerShellGet
shell: pwsh
# Import GPG key so that we can sign the commit
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.GPGKEY }}
passphrase: ${{ secrets.GPGPASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
git_tag_gpgsign: true
git_push_gpgsign: false
git_committer_name: ${{ secrets.COMMIT_NAME }}
git_committer_email: ${{ secrets.COMMIT_EMAIL }}
# Push the updated module to the PowerShell Gallery
- name: Push module to PowerShell Gallery
shell: pwsh
run: |
$params = @{
Path = "${{ github.workspace }}/Evergreen"
NuGetApiKey = "${{ secrets.NUGETAPIKEY }}"
ErrorAction = "Stop"
}
Publish-Module @params