This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
V0.21.1 #76
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: Build, Test and Release | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
paths-ignore: | |
- CHANGELOG.md | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- CHANGELOG.md | |
- .github/** | |
tags: [v*] | |
env: | |
buildFolderName: output | |
buildArtifactName: output | |
testResultFolderName: testResults | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: 'Build and Package Module' | |
uses: ./.github/actions/build | |
test-linux: | |
name: Test on Linux | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: 'Test on Linux' | |
uses: ./.github/actions/test-linux | |
code-coverage: | |
name: Publish Code Coverage | |
if: success() || failure() | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- test-linux | |
# - test-win | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: 'Publish Code Coverage' | |
uses: ./.github/actions/code-coverage | |
release: | |
if: success() && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- test-linux | |
- code-coverage | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Update PowerShell | |
uses: bjompen/UpdatePWSHAction@v1.0.0 | |
with: | |
ReleaseVersion: 'stable' | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ env.buildArtifactName }} | |
path: ${{ env.buildFolderName }} | |
- name: Publish Release | |
shell: pwsh | |
run: Import-Module ./output/RequiredModules/PowerShellForGitHub/0.16.1/PowerShellForGitHub.psd1 ; ./build.ps1 -tasks publish | |
env: | |
GitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
GalleryApiToken: ${{ secrets.BICEPNET_PSGALLERY_KEY }} | |
- name: Send Changelog PR | |
shell: pwsh | |
run: Get-Module -Name PowerShellForGitHub -ListAvailable ;./build.ps1 -tasks Create_ChangeLog_GitHub_PR | |
env: | |
GitHubToken: ${{ secrets.GITHUB_TOKEN }} |