Skip to content

Commit 4843c4d

Browse files
committed
Enhance GitHub Actions workflow to include NuGet packaging and publishing
1 parent 3cbd758 commit 4843c4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/dotnet.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will build a .NET project
1+
# This workflow will build a .NET project and publish changes to NuGet
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

44
name: .NET
@@ -26,3 +26,9 @@ jobs:
2626
run: dotnet build --no-restore
2727
- name: Test
2828
run: dotnet test --no-build --verbosity normal
29+
- name: Pack
30+
run: dotnet pack --no-build -o ./nupkg
31+
- name: Push to NuGet
32+
env:
33+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
34+
run: dotnet nuget push ./nupkg/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)