Skip to content

Merge pull request #72 from dotTrench/fix/new-solution #57

Merge pull request #72 from dotTrench/fix/new-solution

Merge pull request #72 from dotTrench/fix/new-solution #57

Workflow file for this run

name: Build NuGet package
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x
10.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --configuration Release
- name: Pack
run: dotnet pack --configuration Release -o /tmp/nupkgs -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Push
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push "/tmp/nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json