-
-
Notifications
You must be signed in to change notification settings - Fork 73
28 lines (24 loc) · 896 Bytes
/
publish-module.yml
File metadata and controls
28 lines (24 loc) · 896 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
name: Publish PowerShell Module
on:
release:
types: [published]
workflow_dispatch:
jobs:
test-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate module loads
shell: pwsh
run: |
Import-Module ./Module/IntuneAssignmentChecker -Force -ErrorAction Stop
$commands = Get-Command -Module IntuneAssignmentChecker
Write-Host "Module loaded successfully with $($commands.Count) exported commands"
$commands | Sort-Object Name | ForEach-Object { Write-Host " - $($_.Name)" }
- name: Publish to PowerShell Gallery
shell: pwsh
env:
PS_GALLERY_API_KEY: ${{ secrets.NUGET_KEY }}
run: |
Publish-Module -Path ./Module/IntuneAssignmentChecker -Repository PSGallery -NuGetApiKey $env:PS_GALLERY_API_KEY