Skip to content

Update PublishNugetPackage.yml #11

Update PublishNugetPackage.yml

Update PublishNugetPackage.yml #11

name: Publish PowerShell Module
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update module version
shell: pwsh
run: |
$modulePath = "./PowerDataOps.psd1"
$module = [PsCustomObject] (Import-PowerShellDataFile ".\PowerDataOps.psd1")
$module.ModuleVersion = [version]::new($module.ModuleVersion.Major, $module.ModuleVersion.Minor, $module.ModuleVersion.Build + 1)
$module | Out-String | Set-Content $modulePath
- name: Publish to PSGallery
shell: pwsh
run: |
Publish-Module -Path "./path/to/your/module" -NuGetApiKey ${{ secrets.PS_GALLERY_KEY }}
env:
PS_GALLERY_KEY: ${{ secrets.PS_GALLERY_KEY }}