-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (56 loc) · 1.83 KB
/
publish.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
60
61
62
63
# This is a basic workflow to help you get started with Actions
name: Publish to Nuget
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore -p:NoWarn=CS1591
- name: Test
run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal
Publish:
runs-on: windows-latest
needs: [Tests]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:NoWarn=CS1591
- name: Test Again
run: dotnet test -c Release --no-build --no-restore --verbosity normal
- name: Pack
run: dotnet pack -o publishOutput -c Release --no-restore --no-build --verbosity normal
# Runs a set of commands using the runners shell
- name: Push to Nuget
run: dotnet nuget push publishOutput\*.nupkg -k ${{ secrets.NUGET_UPDATEKEY }} -s https://api.nuget.org/v3/index.json