ci: Preparing library for publish #1
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 to PowerShell Gallery | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
build-and-publish: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build PowerShell module | |
run: dotnet build .\src\SvR.ContentPrep.Cmdlet -c Release -o .\dist\SvRooij.ContentPrep.Cmdlet | |
# - name: Analyses | |
# shell: pwsh | |
# run: | | |
# Import-Module .\dist\SvRooij.ContentPrep.Cmdlet\SvR.ContentPrep.Cmdlet.psd1 | |
# Install-Module -Name PSScriptAnalyzer | |
# Invoke-ScriptAnalyzer -Path .\dist\SvRooij.ContentPrep.Cmdlet\SvR.ContentPrep.Cmdlet.psd1 | |
# - name: Publish to PowerShell Gallery | |
# shell: pwsh | |
# run: | | |
# Import-Module .\dist\SvRooij.ContentPrep.Cmdlet\SvR.ContentPrep.Cmdlet.psd1 | |
# Install-Module -Name PowerShellGet -Force -SkipPublisherCheck | |
# Publish-Module -Path .\dist\SvRooij.ContentPrep.Cmdlet\ -NuGetApiKey ${{ secrets.PSGALLERY_API_KEY }} -Verbose | |
# - name: Publish to PowerShell Gallery | |
# uses: PowerShell/[email protected] | |
# with: | |
# PowerShellGalleryApiKey: ${{ secrets.PSGALLERY_API_KEY }} | |
# Path: './path/to/module' |