Skip to content

Commit 40fd9c2

Browse files
authored
Create nuget.yml
1 parent d26261e commit 40fd9c2

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/nuget.yml

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

0 commit comments

Comments
 (0)