-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (71 loc) · 2.84 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
push:
branches:
- dev
- main
jobs:
test:
name: Testing
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Deubg1
run: cat PAMU_CDS/XrmMockupCdsTrigger.cs
- name: Run tests
run: dotnet test --verbosity normal --configuration Release
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 nummber
working-directory: ./.github/workflows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: thygesteffensen
GIT_AUTHOR_EMAIL: [email protected]
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 version
run: echo ${env:RELEASE_VERSION}
- name: Setup MSBuild
uses: microsoft/[email protected]
if: ${{ env.RELEASE_VERSION }}
- name: Restore NuGet packages
run: dotnet restore PAMU_CDS.sln /p:Configuration=Release
if: ${{ env.RELEASE_VERSION }}
- name: DotNet Clean
run: dotnet clean
- name: Package PAMU
run: dotnet pack --configuration Release -p:PackageVersion=${env:RELEASE_VERSION} --output artifacts --include-symbols
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: [email protected]
run: npx semantic-release
if: ${{ env.RELEASE_VERSION }}
- uses: actions/upload-artifact@v3
with:
name: PAMU CDS DLL
path: artifacts/PAMU_CDS*
if: ${{ env.RELEASE_VERSION }}
- name: Publish to NuGet
run: dotnet nuget push artifacts/PAMU_CDSce.${{env.RELEASE_VERSION}}.symbols.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGETAPIKEY}}
if: ${{ env.RELEASE_VERSION }}