-
-
Notifications
You must be signed in to change notification settings - Fork 114
63 lines (52 loc) · 2.06 KB
/
dotnet.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
51
52
53
54
55
56
57
58
59
name: .NET
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration Release --no-restore /p:NoWarn=1591
- name: Test
working-directory: ./src
run: dotnet test --configuration Release --no-restore --no-build --verbosity normal
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration Release --no-restore /p:NoWarn=1591
- name: Test
working-directory: ./src
run: dotnet test --configuration Release --no-restore --no-build --verbosity normal
- name: Build project and generate NuGet package
run: |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/BinaryKits.Zpl.Label/BinaryKits.Zpl.Label.csproj
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/BinaryKits.Zpl.Labelary/BinaryKits.Zpl.Labelary.csproj
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/BinaryKits.Zpl.Viewer/BinaryKits.Zpl.Viewer.csproj
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/BinaryKits.Zpl.Protocol/BinaryKits.Zpl.Protocol.csproj
- name: Push NuGet package
if: github.event_name != 'pull_request' && github.repository_owner == 'BinaryKits'
run: |
cd $GITHUB_WORKSPACE/out
dotnet nuget push *.nupkg --source https://www.nuget.org/api/v2/package --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols