Update dependencies #105
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: Continuous Integration | |
| on: push | |
| env: | |
| Configuration: Release | |
| ContinuousIntegrationBuild: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true | |
| TERM: xterm | |
| jobs: | |
| package: | |
| strategy: | |
| matrix: | |
| os: [ macos-latest, ubuntu-latest, windows-latest ] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| checks: write | |
| name: 🛠 Build, test and pack | |
| steps: | |
| - name: 🧑💻 Checkout git repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: 🏎 Optimize Windows runner | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| echo "DOTNET_INSTALL_DIR=D:\dotnet" >> $env:GITHUB_ENV | |
| echo "NUGET_PACKAGES=D:\nuget" >> $env:GITHUB_ENV | |
| - name: 🧑🔧 Install .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 9.0.x | |
| 8.0.x | |
| - name: ℹ️ Show .NET info | |
| run: dotnet --info | |
| - name: 💾 Retrieve cached NuGet packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.NUGET_PACKAGES || '~/.nuget/packages' }} | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget- | |
| - name: ⚙️ Restore NuGet packages | |
| run: dotnet restore | |
| - name: 🏗 Build solution | |
| run: dotnet build --no-restore | |
| - name: 📜 Fix README for nuget.org | |
| run: dotnet run --project tools/mmd/mmd.csproj -- README.md ${{ github.sha }} README.md | |
| - name: 🧪 Run tests | |
| env: | |
| TUNIT_DISABLE_GITHUB_REPORTER: true | |
| # The .nupkg file is created as part of integration tests | |
| run: dotnet test --no-build | |
| - name: 📤 Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: TestResults-${{ runner.os }}.trx | |
| path: "*.trx" | |
| - name: 📤 Upload nugraph diagnostics | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Diagnostics (${{ runner.os }}) | |
| path: "**/*.diagnostics.txt" | |
| - name: 📊 Test Report | |
| uses: dorny/test-reporter@v2 | |
| if: always() | |
| with: | |
| name: 🚦 Test Results | |
| path: '*.trx' | |
| reporter: dotnet-trx | |
| - name: 📤 Upload NuGet package artifact | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NuGet package | |
| path: "*.nupkg" | |
| - name: 📝 Retrieve release notes from tag | |
| if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| git fetch --tags --force | |
| git tag --list ${{ github.ref_name }} --format='%(contents)' > ReleaseNotes.md | |
| - name: 📤 Upload release notes | |
| if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Release Notes | |
| path: ReleaseNotes.md | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: package | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| id-token: write | |
| name: 🐿 Publish | |
| steps: | |
| - name: 📥 Download NuGet package artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet package | |
| - name: 📥 Download release notes artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Release Notes | |
| - name: 🚢 Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Version ${{ github.ref_name }} | |
| body_path: ReleaseNotes.md | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| files: "*.nupkg" | |
| - name: 🔑 Retrieve NuGet API key | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: '0xced' | |
| - name: 🚀 Publish NuGet package on nuget.org | |
| run: dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" |