1+ name : Release
2+
3+ on :
4+ push :
5+ branches :
6+ - dev
7+ - main
8+
9+ jobs :
10+ test :
11+ name : Testing
12+ runs-on : windows-latest
13+ steps :
14+ - name : Checkout repo
15+ uses : actions/checkout@v2
16+
17+ - name : Run tests
18+ run : dotnet test --verbosity normal
19+
20+ release :
21+ name : Releasing
22+ runs-on : windows-latest
23+ needs :
24+ - test
25+ steps :
26+ - name : Checkout repo
27+ uses : actions/checkout@v2
28+
29+ - name : Setup Node.js
30+ uses : actions/setup-node@v1
31+ with :
32+ node-version : 13
33+
34+ - name : Add plugin for conventional commits
35+ run : npm install conventional-changelog-conventionalcommits
36+ working-directory : ./.github/workflows
37+
38+ - name : Add plugin for executing bash commands
39+ run : npm install @semantic-release/exec -D
40+ working-directory : ./.github/workflows
41+
42+ - name : Dry Run Semantic to get next Version nummber
43+ working-directory : ./.github/workflows
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
46+ GIT_AUTHOR_NAME : thygesteffensen
47+ GIT_AUTHOR_EMAIL : 31892312+thygesteffensen@users.noreply.github.com
48+ run : |
49+ 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
50+
51+ - name : Print release verison
52+ run : echo ${env:RELEASE_VERSION}
53+
54+ - name : Setup MSBuild
55+ uses : microsoft/setup-msbuild@v1
56+
57+ - name : Restore NuGet packages
58+ run : nuget restore PowerAutomateMockUp.sln
59+
60+ - name : Package Parser
61+ run : msbuild /t:pack /p:PackageVersion=${env:RELEASE_VERSION} /p:OutputPath=..\\artifacts
62+ if : ${{ env.RELEASE_VERSION }}
63+
64+ - name : Release to GitHub
65+ working-directory : .\\.github\\workflows
66+ env :
67+ CI_NUGET_API_KEY : ${{ secrets.NUGETAPIKEY }}
68+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
69+ GIT_AUTHOR_NAME : thygesteffensen
70+ GIT_AUTHOR_EMAIL : 31892312+thygesteffensen@users.noreply.github.com
71+ run : npx semantic-release
0 commit comments