-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (38 loc) · 1.47 KB
/
build.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
name: dotnet build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore .NET Packages
run: dotnet restore
- name: Build .NET Solution
run: dotnet build --configuration Release --no-restore
- name: Test .NET Solution
run: dotnet test --configuration Release --no-build --filter=Category=UnitTest --logger "trx;LogFileName=test-results.trx"
- uses: actions/upload-artifact@v2
if: success() || failure()
with:
name: test-results
path: "**/test-results.trx"
- name: Pack .NET Solution
run: dotnet pack --configuration Release --no-build --output pack/
- name: Publish .NET Solution to GitHub Packages
continue-on-error: true
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- name: Publish .NET Solution to NuGet.org
env:
apikey: ${{ secrets.NUGET_ORG_KEY }}
if: ${{ env.apikey != '' }}
run: dotnet nuget push pack/*.nupkg --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget
continue-on-error: true