Skip to content

Package Release to GitHub and Nuget #13

Package Release to GitHub and Nuget

Package Release to GitHub and Nuget #13

Workflow file for this run

name: Release Package to NuGet
on:
workflow_dispatch:
jobs:
release-nuget:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.x
8.x
7.x
6.x
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore dependencies
run: dotnet restore --locked-mode
- name: Build
run: dotnet build --no-restore -c Release
- name: Generate Nuget Package
run: dotnet pack --no-build -c Release --output ./artifacts
- name: Publish Nuget Package
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}