Skip to content

Commit 51087cf

Browse files
authored
feat: add nuget push workflow
1 parent 44cb7d0 commit 51087cf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Push to NuGet
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
env:
11+
NET_VERSION: 10.x
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Setup .NET ${{ env.NET_VERSION }}
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: ${{ env.NET_VERSION }}
24+
- name: Restore dependencies
25+
run: dotnet restore
26+
- name: Build
27+
run: dotnet build --no-restore
28+
- name: Test
29+
run: dotnet test --no-build --verbosity normal
30+
- name: Pack
31+
run: dotnet pack -c Release --no-build --no-restore
32+
- name: Push to NuGet
33+
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)