-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.17 KB
/
build.yml
File metadata and controls
48 lines (37 loc) · 1.17 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
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
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@v3
with:
dotnet-version: 9.0.x
- 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 --logger GitHubActions
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- 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 }}