Skip to content

Commit d3812ea

Browse files
committed
add new workflow [publish]
1 parent b2fa052 commit d3812ea

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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

0 commit comments

Comments
 (0)