Skip to content

Manual NuGet Publish #5

Manual NuGet Publish

Manual NuGet Publish #5

name: Manual NuGet Publish
on:
workflow_dispatch:
jobs:
build:
name: Building, Packaging and Publishing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET 9 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build Api
run: dotnet build "Api/.NET API.csproj" --no-restore --configuration Release
- name: Pack NuGet package
run: dotnet pack "Api/.NET API.csproj" --no-build --configuration Release --output ./nupkg
- name: Push NuGet package to nuget.org
run: dotnet nuget push ./nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}