Skip to content

Publish NuGet Package #6

Publish NuGet Package

Publish NuGet Package #6

Workflow file for this run

name: Publish NuGet Package
on:
release:
types: [published]
jobs:
nuget-org:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
dotnet-quality: 'ga'
- name: Restore dependencies
working-directory: src
run: dotnet restore
- name: Build
working-directory: src
run: dotnet build --configuration Release --no-restore
- name: Pack
working-directory: src
run: dotnet pack --configuration Release --no-build --output nupkgs
- name: Push to NuGet.org
working-directory: src
run: dotnet nuget push ./nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} --skip-duplicate