-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (61 loc) · 2.04 KB
/
pipeline.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
name: Pipeline
on:
push:
branches: [ "master" ]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build_test_analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Sonar scan
run: |
dotnet sonarscanner begin /k:"bvkeersop_DocumentBuilder" /o:"bvkeersop" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build ./DocumentBuilder.sln --no-incremental
dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
publish:
runs-on: ubuntu-latest
needs: build_test_analyze
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Display Version
run: "echo SemVer: $GITVERSION_SEMVER"
- name: Pack
run: dotnet pack -o . -c Release /p:Version=2.1.2
- name: Publish
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json