v0.4.4 #28
Workflow file for this run
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
# File: .github/workflows/qa.yml | |
on: | |
release: | |
types: | |
- "published" | |
workflow_dispatch: | |
name: Publish Module to PSGallery | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PSRule module | |
shell: pwsh | |
run: | | |
Install-Module -Name PSRule -Force -Scope CurrentUser -Repository PSGallery | |
# Update the module manifest for preview-release | |
- name: Update the module manifest for preview-release | |
if: github.event.release.prerelease == true | |
shell: pwsh | |
run: | | |
# Update the module manifest with the version number in the release tag | |
$version = ($env:GITHUB_REF -replace 'refs/tags/v','') -split '-' | Select-Object -First 1 | |
$prerelease = "-" + (($env:GITHUB_REF -replace 'refs/tags/v') -split '-' | Select-Object -Last 1) | |
$path = './src/PSRule.Rules.AzureDevOps/PSRule.Rules.AzureDevOps.psd1' | |
Update-ModuleManifest -Path $path -ModuleVersion $version -ReleaseNotes "${{ github.event.release.body }}" -Prerelease $prerelease | |
# Update the module manifest for full-release | |
- name: Update the module manifest for full-release | |
if: github.event.release.prerelease == false | |
shell: pwsh | |
run: | | |
# Update the module manifest with the version number in the release tag | |
$version = $env:GITHUB_REF -replace 'refs/tags/v' | |
$path = './src/PSRule.Rules.AzureDevOps/PSRule.Rules.AzureDevOps.psd1' | |
Update-ModuleManifest -Path $path -ModuleVersion $version -ReleaseNotes "${{ github.event.release.body }}" | |
# Publish to PowerShell Gallery on pre-release | |
- name: Publish preview module | |
if: github.event.release.prerelease == true | |
shell: pwsh | |
id: publish-module-preview | |
run: | | |
Publish-Module -Path ./src/PSRule.Rules.AzureDevOps -NuGetApiKey ${{ secrets.PS_GALLERY_KEY }} -Repository PSGallery | |
# Publish to PowerShell Gallery on full-release | |
- name: Publish module | |
if: github.event.release.prerelease == false | |
shell: pwsh | |
id: publish-module | |
run: | | |
Publish-Module -Path ./src/PSRule.Rules.AzureDevOps -NuGetApiKey ${{ secrets.PS_GALLERY_KEY }} |