-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (106 loc) · 3.19 KB
/
PublishReleaseAndModule.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: PublishReleaseAndModule
on:
push:
tags: [v*]
env:
buildFolderName: output
buildArtifactName: output
testResultFolderName: testResults
jobs:
build:
name: Build Module
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: 'Build and Package Module'
uses: ./.github/actions/build
test:
name: Test Module
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
needs:
- build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: 'Test Module'
uses: ./.github/actions/test
with:
os: ${{ matrix.os }}
release-github:
name: Publish Release to GitHub
permissions:
contents: write
pull-requests: write
checks: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 2
- name: Configure Git Actor
run: |
# Configure git with github-actions bot to make commits more pretty
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Get changelog
id: get-changelog
uses: release-flow/[email protected]
with:
command: query
version: unreleased
- name: Create Release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}
draft: true
body: ${{ steps.get-changelog.outputs.release-notes }}
- name: Update Changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
tag: ${{ github.ref_name }}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update changelog for ${{ github.ref_name }}"
title: Update changelog for ${{ github.ref_name }}
body: Automatic update of changelog for release ${{ github.ref_name }}.
labels: documentation
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: changelog-${{ github.ref_name }}
release-psgallery:
name: Publish to PowerShell Gallery
runs-on: ubuntu-latest
needs:
- build
- test
env:
GalleryApiToken: ${{ secrets.PSGALLERY_KEY }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Download Build Artifact
uses: actions/[email protected]
with:
name: ${{ env.buildArtifactName }}
path: ${{ env.buildFolderName }}
- name: Publish Release
shell: pwsh
run: Import-Module ./output/RequiredModules/PowerShellForGitHub; ./build.ps1 -tasks publish
env:
GitHubToken: ${{ secrets.GITHUB_TOKEN }}
GalleryApiToken: ${{ secrets.PSGALLERY_KEY }}