Skip to content

Commit 1d5ff17

Browse files
committed
publish action added
1 parent 6bacf6e commit 1d5ff17

3 files changed

Lines changed: 43 additions & 928 deletions

File tree

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: |
21+
8.0.x
22+
10.0.x
23+
24+
- name: Restore
25+
run: dotnet restore
26+
27+
- name: Build
28+
run: dotnet build -c Release --no-restore
29+
30+
- name: Test
31+
run: dotnet test -c Release --no-build
32+
33+
- name: Pack
34+
run: dotnet pack src/PatchSharp/PatchSharp.csproj -c Release --no-build -o artifacts
35+
36+
- name: NuGet login (OIDC trusted publishing)
37+
uses: NuGet/login@v1
38+
id: login
39+
with:
40+
user: ${{ secrets.NUGET_USER }}
41+
42+
- name: Push to NuGet
43+
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)