-
-
Notifications
You must be signed in to change notification settings - Fork 147
43 lines (32 loc) · 1.3 KB
/
publishnuget.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
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 packages
run: |
dotnet pack ${{ github.event.repository.name }} -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"
dotnet pack ${{ github.event.repository.name }}.Configuration -c Release --no-restore --no-build -p:Version="${{ github.event.release.tag_name }}"
dotnet pack ${{ github.event.repository.name }}.DependencyInjection -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}}