Skip to content

Bump to .NET 6 minimum #3

Bump to .NET 6 minimum

Bump to .NET 6 minimum #3

Workflow file for this run

name: Publish NuGet Package
on:
push:
tags:
- 'v*' # e.g. v1.0.0, v2.1.3
jobs:
build:
runs-on: ubuntu-latest # ✅ use Ubuntu 20.04 for .NET 5 support
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore
- name: Build project
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --configuration Release --no-build
- name: Pack NuGet package
run: dotnet pack --configuration Release --no-build -o ./artifacts /p:PackageVersion=${{ env.PACKAGE_VERSION }}
- name: Publish NuGet package
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json