Update PowerDataOps.psd1 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
$currentVersion = [version] $module.ModuleVersion; | |
$newVersion = [version]::new($currentVersion.Major, $currentVersion.Minor, $currentVersion.Build, $currentVersion.Revision + 1); | |
Write-Host "New Module Version = $($newVersion.ToString())"; | |
$module.ModuleVersion = $newVersion.ToString(); | |
$module | Out-String | Set-Content $modulePath | |
- name: Publish to PSGallery | |
shell: pwsh | |
run: | | |
Publish-Module -Path "./" -NuGetApiKey "${{ secrets.PS_GALLERY_KEY }}" -SkipAutomaticTags -Verbose | |
env: | |
PS_GALLERY_KEY: ${{ secrets.PS_GALLERY_KEY }} |