-
Notifications
You must be signed in to change notification settings - Fork 72
42 lines (38 loc) · 1.06 KB
/
dotnet.yml
File metadata and controls
42 lines (38 loc) · 1.06 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
name: .NET
on:
push:
branches: [ main, 'release/*' ]
pull_request:
branches: [ main, 'release/*' ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.0.x
9.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Pack NuGet packages
if: github.event_name != 'pull_request' && matrix.os == 'windows-latest'
run: dotnet pack -c Release --no-build --output nupkgs
- name: Upload NuGet packages
if: github.event_name != 'pull_request' && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: nupkgs/
retention-days: 30