Skip to content

Upgrade to .NET 9.0 #36

Upgrade to .NET 9.0

Upgrade to .NET 9.0 #36

Workflow file for this run

name: Publish to NuGet
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore src/Persia.Net/Persia.Net.csproj
- name: Build
run: dotnet build src/Persia.Net/Persia.Net.csproj --configuration Release --no-restore
- name: Restore test project dependencies
run: dotnet restore src/Persia.Net.Test/Persia.Net.Test.csproj
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Set version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=1.0.0
fi
echo "::set-output name=version::$VERSION"
- name: Pack
run: dotnet pack src/Persia.Net/Persia.Net.csproj --no-build --configuration Release /p:PackageVersion=${{ steps.version.outputs.version }} --output nupkg
- name: Push
run: dotnet nuget push "nupkg/*.nupkg" --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json