Skip to content

Commit aa3ec86

Browse files
authored
Create publish-script.yml
1 parent 7414824 commit aa3ec86

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish PowerShell Script
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
Publish-Script:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Publish to PowerShell Gallery
14+
shell: pwsh
15+
run: |
16+
$env:PSGalleryApiKey = "${{ secrets.NUGET_KEY }}"
17+
Publish-Script -Path ./DeviceOffboardingManager.ps1 -Repository PSGallery -NuGetApiKey $env:PSGalleryApiKey
18+
19+
- name: Add Gallery Link to Summary
20+
shell: bash
21+
run: |
22+
version=$(grep -Po '^\.VERSION \K[0-9.]+' ./DeviceOffboardingManager.ps1)
23+
echo "Successfully published [DeviceOffboardingManager version $version](https://www.powershellgallery.com/packages/DeviceOffboardingManager/$version) to PowerShell Gallery." >> $GITHUB_STEP_SUMMARY
24+
echo "View the package at: https://www.powershellgallery.com/packages/DeviceOffboardingManager/$version"

0 commit comments

Comments
 (0)