v2.0.0 - Model Redesign #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Release" | |
| permissions: | |
| contents: read | |
| packages: write | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| publish_to_nuget: | |
| description: 'Publish to NuGet.org' | |
| required: false | |
| type: boolean | |
| default: false | |
| jobs: | |
| version: | |
| name: "Determine Version" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.gitversion.outputs.SemVer }} | |
| nuget-version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} | |
| assembly-version: ${{ steps.gitversion.outputs.AssemblySemVer }} | |
| file-version: ${{ steps.gitversion.outputs.AssemblySemFileVer }} | |
| informational-version: ${{ steps.gitversion.outputs.InformationalVersion }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v4 | |
| with: | |
| versionSpec: '6.x' | |
| - name: Determine Version | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v4 | |
| - name: Display GitVersion outputs | |
| run: | | |
| echo "SemVer: ${{ steps.gitversion.outputs.SemVer }}" | |
| echo "NuGet Version: ${{ steps.gitversion.outputs.NuGetVersionV2 }}" | |
| echo "Assembly Version: ${{ steps.gitversion.outputs.AssemblySemVer }}" | |
| echo "File Version: ${{ steps.gitversion.outputs.AssemblySemFileVer }}" | |
| echo "Informational Version: ${{ steps.gitversion.outputs.InformationalVersion }}" | |
| build: | |
| name: "Build (.NET ${{ matrix.dotnet-version }})" | |
| needs: version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - dotnet-version: '8.0.x' | |
| dotnet-moniker: 'net8.0' | |
| - dotnet-version: '9.0.x' | |
| dotnet-moniker: 'net9.0' | |
| - dotnet-version: '10.0.x' | |
| dotnet-moniker: 'net10.0' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Setup .NET ${{ matrix.dotnet-version }}" | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| - name: "Restore" | |
| run: dotnet restore -p:TargetFramework=${{ matrix.dotnet-moniker }} | |
| - name: "Build" | |
| run: | | |
| dotnet build -c Release --no-restore --framework ${{ matrix.dotnet-moniker }} \ | |
| -p:Version=${{ needs.version.outputs.version }} \ | |
| -p:AssemblyVersion=${{ needs.version.outputs.assembly-version }} \ | |
| -p:FileVersion=${{ needs.version.outputs.file-version }} \ | |
| -p:InformationalVersion=${{ needs.version.outputs.informational-version }} | |
| - name: "Test" | |
| run: | | |
| dotnet test -c Release --no-restore --no-build --verbosity normal --framework ${{ matrix.dotnet-moniker }} \ | |
| /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*" | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| publish: | |
| name: "Publish Packages" | |
| needs: [version, build] | |
| uses: ./.github/workflows/publish-packages.yml | |
| with: | |
| nuget: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_nuget == 'true') }} | |
| version: ${{ needs.version.outputs.nuget-version }} | |
| assembly-version: ${{ needs.version.outputs.assembly-version }} | |
| file-version: ${{ needs.version.outputs.file-version }} | |
| informational-version: ${{ needs.version.outputs.informational-version }} | |
| clean: | |
| name: "Cleaning Old Packages" | |
| needs: publish | |
| uses: ./.github/workflows/clean-packages.yml |