-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (29 loc) · 972 Bytes
/
punlishnuget.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
name: Publish Nuget Package
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '8.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore /p:Version="${{ github.event.release.tag_name }}"
- name: Run tests
run: dotnet test -c Release --no-restore --no-build
- name: Create package
run: dotnet pack -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"
- name: Publish
run: dotnet nuget push **\*.nupkg -s 'https://api.nuget.org/v3/index.json' -k ${{secrets.NUGET_API_KEY}}