Skip to content

Commit 0a29d0b

Browse files
authored
Create dotnet.yml
1 parent a6a1742 commit 0a29d0b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/dotnet.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: .NET Core
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Setup .NET 4.6.2
20+
uses: actions/setup-dotnet@v1
21+
with:
22+
dotnet-version: '4.6.2'
23+
- name: Setup .NET Core 2.1
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: '2.1.x'
27+
- name: Setup .NET Core 3.1
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: '3.1.x'
31+
- name: Setup .NET 5.0
32+
uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: '5.0.x'
35+
- name: Fix Windows VM bug
36+
shell: bash
37+
if: matrix.os == 'windows-latest'
38+
run: |
39+
dotnet nuget locals all --clear
40+
- name: Restore
41+
run: dotnet restore
42+
- name: Build
43+
run: dotnet build --configuration Release --no-restore
44+
- name: Test
45+
run: dotnet test --no-restore --verbosity normal
46+
- name: Pack
47+
if: matrix.os == 'ubuntu-latest'
48+
run: dotnet pack -c Release
49+
- name: Publish artifact
50+
if: matrix.os == 'ubuntu-latest'
51+
uses: actions/upload-artifact@v2
52+
with:
53+
name: nupkg
54+
path: '**/*.nupkg'

0 commit comments

Comments
 (0)