Skip to content

Enhance NuGet publish workflow with clean and build #9

Enhance NuGet publish workflow with clean and build

Enhance NuGet publish workflow with clean and build #9

Workflow file for this run

name: Publish to NuGet
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: |
dotnet clean --configuration Release
dotnet build --configuration Release
dotnet pack --configuration Release --no-build --output nupkgs
- name: Push to NuGet
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json