File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 55 branches : [ "main" ]
66 pull_request :
77 branches : [ "main" ]
8+ release :
9+ types : [ "created" ]
810
911jobs :
1012 build :
1113 runs-on : ubuntu-latest
12-
1314 steps :
1415 - uses : actions/checkout@v4
1516 - name : Setup .NET
2223 run : dotnet build --no-restore
2324 - name : Test
2425 run : dotnet test --no-restore --no-build --verbosity normal
26+
27+ release :
28+ needs : build
29+ runs-on : ubuntu-latest
30+ if : github.event_name == 'release' && github.event.action == 'created'
31+ steps :
32+ - uses : actions/checkout@v4
33+ - name : Setup .NET
34+ uses : actions/setup-dotnet@v4
35+ with :
36+ dotnet-version : 8.x
37+ - name : Restore dependencies
38+ run : dotnet restore
39+ - name : Pack NuGet package
40+ run : dotnet pack --no-restore -c Release -o ./artifacts
41+ - name : Publish to NuGet
42+ env :
43+ NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
44+ run : dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
You can’t perform that action at this time.
0 commit comments