File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish NuGet (on [publish] commit)
2+
3+ on :
4+ push :
5+ branches :
6+ - " **"
7+
8+ jobs :
9+ publish :
10+ if : contains(github.event.head_commit.message, '[publish]')
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+
19+ - name : Setup .NET
20+ uses : actions/setup-dotnet@v4
21+ with :
22+ dotnet-version : " 10.0.x"
23+
24+ - name : Restore
25+ run : |
26+ dotnet restore ./S2PluginKit.slnx || dotnet restore ./S2PluginKit.csproj
27+
28+ - name : Build (Release)
29+ run : |
30+ dotnet build ./S2PluginKit.slnx -c Release --no-restore || \
31+ dotnet build ./S2PluginKit.csproj -c Release --no-restore
32+
33+ - name : Verify package exists
34+ run : |
35+ ls -la artifacts
36+ test -f artifacts/*.nupkg
37+
38+ - name : Push package to NuGet.org
39+ run : |
40+ dotnet nuget push "artifacts/*.nupkg" \
41+ --source https://api.nuget.org/v3/index.json \
42+ --api-key ${{ secrets.NUGET_API_KEY }} \
43+ --skip-duplicate
You can’t perform that action at this time.
0 commit comments