Skip to content

Commit f5cabae

Browse files
Refine GitHub Actions publish workflow
Updated the publish workflow to trigger on version tags and modified comments for clarity.
1 parent 7346ced commit f5cabae

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/publish

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v3
17+
with:
18+
dotnet-version: '8.0.x'
19+
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
23+
- name: Build
24+
run: dotnet build --configuration Release --no-restore
25+
26+
- name: Pack
27+
run: dotnet pack --configuration Release --no-build -o .
28+
29+
- name: Push to NuGet
30+
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)