-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (55 loc) · 1.77 KB
/
release.yml
File metadata and controls
70 lines (55 loc) · 1.77 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
name: release
on:
release:
types:
- published
- unpublished
- deleted
defaults:
run:
shell: pwsh
env:
RELEASE_ID: ${{ github.event.release.id }}
TAG_NAME: ${{ github.event.release.tag_name }}
POWERSHELLGALLERY_KEY: ${{ secrets.POWERSHELLGALLERY_KEY }}
jobs:
preflight:
runs-on: ubuntu-latest
if: ${{ github.event.action != 'unpublished' && github.event.action != 'deleted' }}
steps:
- uses: actions/checkout@v2
- uses: powershell-devops/install-module@v1
- name: Install pre-requisites
run: Install-Module Pester -MinimumVersion 5.2.0 -Force
# Require the pester tests work to be able to publish a version
- name: Pester tests
if: ${{ github.event.action == 'published' }}
run: Invoke-Pester -Output Detailed
- id: verify
name: Verify module version
run: ./.github/workflows/scripts/verify.ps1
publish:
if: ${{ github.event.action == 'published' }}
needs: preflight
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: powershell-devops/install-module@v1
- name: Publish to PowerShellGallery
run: ./.github/workflows/scripts/publish.ps1
- name: Update major version tag
if: ${{ env.MAJOR_TAG_NAME != '' }}
uses: richardsimko/update-tag@v1
with:
tag_name: ${{ env.MAJOR_TAG_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unlist:
if: ${{ github.event.action == 'unpublished' || github.event.action == 'deleted' }}
needs: preflight
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: powershell-devops/install-module@v0
- name: Unlist from PowerShellGallery
run: ./.github/workflows/scripts/unlist.ps1