diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 61f990c..f93d3d5 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -62,3 +62,18 @@ jobs: files: output/release.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Module to PowerShell Gallery + shell: pwsh + run: | + $apiKey = '${{ secrets.POWERSHELLGALLERY }}' + $modulePath = "C:\a\PiHoleShell\PiHoleShell\PiHoleShell" # Change to your actual module folder + $manifest = Get-ChildItem -Path $modulePath -Filter PiHoleShell.psd1 -Recurse | Select-Object -First 1 + Get-Content $($manifest.fullname) -replace '0.0.0', ${{ steps.bump.outputs.new_tag }} | Out-File $manifest.fullname + + if (-not $manifest) { + throw "No module manifest (*.psd1) found in $modulePath" + } + + Write-Host "Publishing module: $($manifest.FullName)" + Publish-Module -Path $manifest.DirectoryName -NuGetApiKey $apiKey -Verbose \ No newline at end of file diff --git a/PiHoleShell/PiHoleShell.psd1 b/PiHoleShell/PiHoleShell.psd1 index d48b9ad..260ed87 100644 Binary files a/PiHoleShell/PiHoleShell.psd1 and b/PiHoleShell/PiHoleShell.psd1 differ