-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.32 KB
/
build.yml
File metadata and controls
51 lines (40 loc) · 1.32 KB
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
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Install GitVersion
run: dotnet tool install -g GitVersion.Tool --version 5.*
- name: Execute GitVersion
id: version
run: dotnet-gitversion /output buildserver
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: 10.0.x
global-json-file: './global.json'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Pack
run: dotnet pack -c Release --no-build /p:PackageVersion=${{ env.GitVersion_SemVer }}
- name: Test
run: dotnet test -c Release --no-build --verbosity normal --report-github --coverlet --coverlet-output-format opencover
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Push
if: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
run: dotnet nuget push "**/*.nupkg" -s https://api.nuget.org/v3/index.json -k $NUGET_AUTH_TOKEN
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}