-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (50 loc) · 1.6 KB
/
dotnet.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
name: Build and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["6.0.x", "8.0.x", "9.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-versions: ${{ matrix.dotnet-version }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: "5.x"
preferLatestVersion: true
- name: Determine Version
id: version # step id used as reference for output values
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
if: ${{ always() }}
- name: Package
run: dotnet pack --output pkg
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: BobTheBuilder.${{ steps.version.outputs.majorMinorPatch }}.nupkg
path: pkg/BobTheBuilder.${{ steps.version.outputs.majorMinorPatch }}.nupkg