-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (41 loc) · 1.18 KB
/
nuget.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
name: Publish NuGet package
on:
release:
types: [ published ]
push:
branches: [ main ]
permissions:
contents: read
pull-requests: read
jobs:
publish:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --configuration Release --no-build --include-symbols --output ./nupkgs
- name: Archive NuGet artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./nupkgs/*.nupkg
- name: Archive NuGet symbols artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-symbol-packages
path: ./nupkgs/*.snupkg
- name: Push
run: dotnet nuget push './nupkgs/*.nupkg' -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json