Updated readme #107
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
name: Publish to PowerShell Gallery | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: GitVersion | |
id: gitversion | |
uses: PoshCode/Actions/gitversion@v1 | |
- name: Install-RequiredModules | |
uses: PoshCode/Actions/install-requiredmodules@v1 | |
- name: Build Module | |
id: build | |
uses: PoshCode/actions/build-module@v1 | |
with: | |
path: ${{github.workspace}}/Source | |
version: ${{ steps.gitversion.outputs.LegacySemVerPadded }} | |
destination: ${{github.workspace}}/output | |
- name: Upload Build Output | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Modules | |
path: ${{github.workspace}}/output | |
- name: Upload Tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PesterTests | |
path: ${{github.workspace}}/Tests | |
- name: Upload RequiredModules.psd1 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: RequiredModules | |
path: ${{github.workspace}}/RequiredModules.psd1 | |
- name: Upload PSScriptAnalyzerSettings.psd1 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ScriptAnalyzer | |
path: ${{github.workspace}}/PSScriptAnalyzerSettings.psd1 | |
lint: | |
needs: build | |
name: Run PSScriptAnalyzer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Build Output | |
uses: actions/download-artifact@v3 | |
- name: Invoke-ScriptAnalyzer | |
uses: devblackops/github-action-psscriptanalyzer@master | |
with: | |
rootPath: Modules/ModuleBuilder | |
repoToken: ${{ secrets.GITHUB_TOKEN }} | |
test: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
steps: | |
- name: Download Build Output | |
uses: actions/download-artifact@v3 | |
- uses: PoshCode/Actions/install-requiredmodules@v1 | |
- uses: PoshCode/Actions/pester@v1 | |
with: | |
codeCoveragePath: Modules/ModuleBuilder | |
moduleUnderTest: ModuleBuilder | |
additionalModulePaths: ${{github.workspace}}/Modules | |
- name: Publish Test Results | |
uses: zyborg/dotnet-tests-report@v1 | |
with: | |
test_results_path: results.xml | |
- name: Upload Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Pester Results | |
path: ${{github.workspace}}/*.xml | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Build Output | |
uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Install-RequiredModules | |
uses: PoshCode/Actions/install-requiredmodules@v1 | |
with: | |
requiredModules-path: ${{github.workspace}}/RequiredModules/RequiredModules.psd1 | |
- name: Publish Module to PowerShell Gallery | |
shell: pwsh | |
run: | | |
Install-Module -Name Microsoft.PowerShell.ConsoleGuiTools -Force -SkipPublisherCheck -Scope CurrentUser | |
Install-Module -Name PSReadLine -Force -SkipPublisherCheck -Scope CurrentUser | |
Publish-Module -Path ${{github.workspace}}/Modules/F7History/${{ steps.gitversion.outputs.LegacySemVerPadded }} -NuGetApiKey ${{ secrets.F7HISTORY_GALLERY_KEY }} | |