Skip to content

Commit 328f381

Browse files
authored
Create publish.yml
1 parent bcaa4bd commit 328f381

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)