Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish to PS Gallery

on:
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
runs-on: windows-latest

steps:
- uses: actions/checkout@v6

- name: Publish module to PowerShell Gallery
shell: pwsh
env:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
run: |
$isPreview = '${{ github.ref_name }}' -ne 'master'
Write-Host "Branch: ${{ github.ref_name }} | Preview: $isPreview"
./tools/Publish-ToGallery.ps1 -IsPreview:$isPreview -NuGetApiKey $env:PSGALLERY_API_KEY
18 changes: 18 additions & 0 deletions tools/Publish-ToGallery.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[CmdletBinding()]
param (
[switch]$IsPreview,

[Parameter(Mandatory)]
[string]$NuGetApiKey
)

$modulePath = Resolve-Path (Join-Path $PSScriptRoot '..')
$manifestPath = Join-Path $modulePath 'azure.datafactory.tools.psd1'

if ($IsPreview) {
Write-Host "Tagging module as prerelease (preview)..."
Update-ModuleManifest -Path $manifestPath -Prerelease 'preview'
}

Write-Host "Publishing module from: $modulePath"
Publish-Module -Path $modulePath -NuGetApiKey $NuGetApiKey -Verbose
Loading