Skip to content

Commit

Permalink
Create nuget-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
desmondinho authored May 10, 2024
1 parent dd997cb commit 3c2c181
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
release:
types: [published]

jobs:
build:
name: Release to NuGet
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build
run: dotnet build -c Release

- name: Test
run: dotnet test -c Release --no-build

- name: Pack NuGet package
run: dotnet pack -c Release --no-build --output nupkgs
working-directory: ./src

- name: Push to NuGet
run: dotnet nuget push nupkgs/*.nupkg" -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json
working-directory: ./src

0 comments on commit 3c2c181

Please sign in to comment.