File tree Expand file tree Collapse file tree 2 files changed +42
-3
lines changed
Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 44name : .NET
55
66on :
7- push :
8- branches : [ "main" ]
97 pull_request :
108 branches : [ "main" ]
9+ push :
10+ branches : [ "main" ]
1111
1212jobs :
1313 build :
14-
14+ name : " .NET / build "
1515 runs-on : windows-latest
1616
1717 steps :
2424 run : dotnet restore
2525 - name : Build
2626 run : dotnet build --no-restore
27+ - name : Build release
28+ run : dotnet build --configuration Release --no-restore
2729 - name : Test
2830 run : dotnet test --no-build --verbosity normal
31+ - name : Test release
32+ run : dotnet test --configuration Release --no-build --verbosity normal
Original file line number Diff line number Diff line change 1+ # Publishes a .NET package to NuGet when a new tag is pushed.
2+
3+ name : Publish NuGet Package
4+
5+ on :
6+ push :
7+ tags : ['v*.*.*'] # fires on v0.1.0, v0.1.0-rc.1, etc.
8+ workflow_dispatch :
9+
10+ jobs :
11+ publish :
12+ name : " .NET / Publish"
13+ runs-on : windows-latest
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+ with : { fetch-depth: 0 }
18+ - name : Setup .NET
19+ uses : actions/setup-dotnet@v4
20+ with :
21+ dotnet-version : 9.0.x
22+ - name : Restore dependencies
23+ run : dotnet restore
24+ - name : Build
25+ run : dotnet build -c Release --no-restore
26+ - name : Pack
27+ run : dotnet pack -c Release --no-build -o ./artifacts
28+ - name : Publish to NuGet
29+ run : |
30+ Get-ChildItem -Path ./artifacts -Filter *.nupkg | ForEach-Object {
31+ dotnet nuget push $_.FullName `
32+ --api-key ${{ secrets.NUGET_API_KEY }} `
33+ --source https://api.nuget.org/v3/index.json `
34+ --skip-duplicate
35+ }
You can’t perform that action at this time.
0 commit comments