-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 980 Bytes
/
publish-module.yml
File metadata and controls
34 lines (28 loc) · 980 Bytes
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
name: Publish Module
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
name: quickpath
search_artifacts: true
branch: main
- name: Extract package
shell: pwsh
run: Expand-Archive -Path quickpath.zip -DestinationPath .
- name: Override module version
run: |
$tag = "${{ github.event.release.tag_name }}"
$versionWithoutV = $tag -replace "^v", ""
(Get-Content 'quickpath/quickpath.psd1') -replace "ModuleVersion\s*=\s*'[^']+'", "ModuleVersion = '$versionWithoutV'" | Set-Content 'quickpath/quickpath.psd1'
shell: pwsh
- name: Publish Module
shell: pwsh
run: Publish-Module -Path quickpath -NuGetApiKey ${{ secrets.NUGET_API_KEY }}