Skip to content

Commit 269d308

Browse files
authored
Merge pull request #7 from selfmadecode/feature/add-implementations
add steps to publish to nuget
2 parents 7e51b22 + 9edb702 commit 269d308

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish NuGet Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
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 Throttlr.Api.RateLimit.sln
22+
23+
- name: Build solution
24+
run: dotnet build Throttlr.Api.RateLimit.sln --configuration Release --no-restore
25+
26+
- name: Pack NuGet package
27+
run: dotnet pack src/Throttlr.Api.RateLimit/RateLimit.Throttlr.csproj --configuration Release -o ./artifacts /p:PackageVersion=${{ github.ref_name }}
28+
29+
- name: Publish to NuGet
30+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

0 commit comments

Comments
 (0)