-
Notifications
You must be signed in to change notification settings - Fork 23
57 lines (48 loc) · 1.62 KB
/
release-psdocs.yml
File metadata and controls
57 lines (48 loc) · 1.62 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
name: Release PSDocs
on:
push:
tags:
- 'psdocs-v*'
permissions: {}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
environment: release
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: '8.0.x'
- name: Setup PowerShell modules
shell: pwsh
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name InvokeBuild -MinimumVersion 5.4.0 -Scope CurrentUser -Force
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/psdocs-v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build
shell: pwsh
working-directory: packages/psdocs
run: |
Invoke-Build Build -File ./pipeline.build.ps1 -Build '${{ steps.version.outputs.version }}'
- name: Publish to PSGallery
shell: pwsh
env:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
run: |
Publish-Module -Path packages/psdocs/out/modules/PSDocs -NuGetApiKey $env:PSGALLERY_API_KEY
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
--title "PSDocs v${{ steps.version.outputs.version }}" \
--notes-file packages/psdocs/CHANGELOG.md