feat: updgrading to support net10 #229
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: .NET Core | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - develop | |
| pull_request: | |
| branches: [ master, develop, release/**, hotfix/** ] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| semver: ${{ steps.gitversion.outputs.semVer }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Setup .Net SDKs | |
| - name: Setup .NET 6.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Setup .NET 8.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Setup .NET 10.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| # Perform the dotnet actions | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: '**/bin/Release' | |
| # Get the version information | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v3.0 | |
| if: ${{ success() && contains(github.event_name, 'push') }} | |
| with: | |
| versionSpec: '5.x' | |
| - name: Determine Version | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v3.0 | |
| if: ${{ success() && contains(github.event_name, 'push') }} | |
| with: | |
| useConfigFile: true | |
| - name: Display SemVer | |
| if: ${{ success() && contains(github.event_name, 'push') }} | |
| run: | | |
| echo "SemVer: $GITVERSION_SEMVER" | |
| test-linux: | |
| name: Test (Linux) | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET 6.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Setup .NET 8.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-output | |
| - name: Test (net6.0) | |
| run: dotnet test --no-build --configuration Release --framework net6.0 | |
| - name: Test (net8.0) | |
| run: dotnet test --no-build --configuration Release --framework net8.0 | |
| test-windows: | |
| name: Test (Windows) | |
| needs: build | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET Core 3.1 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '3.1.x' | |
| - name: Setup .NET 8.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Setup .NET 10.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-output | |
| - name: Test (netcoreapp3.1) | |
| run: dotnet test --no-build --configuration Release --framework netcoreapp3.1 | |
| - name: Test (net48) | |
| run: dotnet test --no-build --configuration Release --framework net48 | |
| publish: | |
| name: Package and Publish | |
| needs: [build, test-linux, test-windows] | |
| runs-on: ubuntu-latest | |
| if: ${{ success() && contains(github.event_name, 'push') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET 10.0 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-output | |
| - name: Package | |
| run: dotnet pack --no-build --configuration Release --output ./Packages -p:PackageVersion=${{ needs.build.outputs.semver }} | |
| - name: Push | |
| run: | | |
| cd Packages | |
| dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |