Skip to content

Commit 0cc1a88

Browse files
authored
Merge pull request #2 from Mythetech/enable-nuget-action-workflow
Nuget GitHub Actions Workflow
2 parents 1afef7a + 17dc1a3 commit 0cc1a88

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/main.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
name: Publish Package
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v3
20+
with:
21+
dotnet-version: '9.x'
22+
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
26+
- name: Build the project
27+
run: dotnet build --configuration Release
28+
29+
- name: Pack NuGet package
30+
run: dotnet pack --configuration Release --output ./nupkg
31+
32+
- name: Publish to NuGet
33+
env:
34+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
35+
run: dotnet nuget push "./nupkg/*.nupkg" --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)