Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit bbe9c0e

Browse files
Create publish_nuget.yml (#1)
1 parent a96198b commit bbe9c0e

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: NuGet Package
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
build-and-publish:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: '7.0'
21+
22+
- name: Restore dependencies
23+
run: dotnet restore src/SpeedTestSharp/SpeedTestSharp.csproj
24+
25+
- name: Build project
26+
run: dotnet build src/SpeedTestSharp/SpeedTestSharp.csproj --configuration Release
27+
28+
- name: Create NuGet package
29+
run: dotnet pack src/SpeedTestSharp/SpeedTestSharp.csproj --configuration Release
30+
31+
- name: Setup Publish NuGet package
32+
uses: nuget/setup-nuget@v1
33+
with:
34+
nuget-api-key: ${{ secrets.NUGET_API_KEY }} # Replace with your NuGet API key
35+
36+
- name: Publish NuGet package
37+
run: dotnet nuget push src/SpeedTestSharp/bin/Release/*.nupkg --skip-duplicate

0 commit comments

Comments
 (0)