ci: Fix pipeline after refactor #88
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: Release | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
jobs: | |
test: | |
name: Testing | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Run tests | |
run: dotnet test --verbosity normal | |
release: | |
name: Releasing | |
runs-on: windows-latest | |
needs: | |
- test | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
- name: Add plugin for conventional commits | |
run: npm install conventional-changelog-conventionalcommits | |
working-directory: ./.github/workflows | |
- name: Add plugin for executing bash commands | |
run: npm install @semantic-release/exec -D | |
working-directory: ./.github/workflows | |
- name: Dry Run Semantic to get next Version number | |
working-directory: ./.github/workflows | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: thygesteffensen | |
GIT_AUTHOR_EMAIL: 31892312+thygesteffensen@users.noreply.github.com | |
run: | | |
echo "RELEASE_VERSION=$((npx semantic-release --dry-run).Where({ $_ -like '*Release note*' }) | Out-String | Select-String '[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-z]+[.][0-9]*)?' | % { $_.Matches } | % { $_.Value })" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Print release verison | |
run: echo ${env:RELEASE_VERSION} | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1.1 | |
- name: Restore NuGet packages | |
run: nuget restore PowerAutomateMockUp.sln | |
working-directory: ./src | |
- name: Package Parser | |
run: msbuild /t:pack /p:PackageVersion=${env:RELEASE_VERSION} /p:OutputPath=..\\artifacts | |
working-directory: ./src | |
if: ${{ env.RELEASE_VERSION }} | |
- name: Release to GitHub | |
working-directory: .\\.github\\workflows | |
env: | |
CI_NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: thygesteffensen | |
GIT_AUTHOR_EMAIL: 31892312+thygesteffensen@users.noreply.github.com | |
run: npx semantic-release |