-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.4 KB
/
release-nuget.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
name: Release to NuGet
on:
workflow_dispatch:
jobs:
build:
name: nuget Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-restore --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory dist/tests --collect:"XPlat Code Coverage"
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-test-results
path: dist/tests/test-results.trx
if: ${{ always() }}
- name: Upload dotnet test coverage
uses: actions/upload-artifact@v3
with:
name: dotnet-test-coverage
path: dist/tests/**/coverage.cobertura.xml
if: ${{ always() }}
- name: Pack
run: dotnet pack -c Release --output dist/package
- name: Upload Package Artifact
uses: actions/upload-artifact@v3
with:
name: package
path: dist/package/*.nupkg
- name: Push to NuGet
run: dotnet nuget push "dist/package/*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json