.Net 10 and AOT support #3665
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: publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "main" | |
| tags: | |
| - "*" | |
| pull_request: | |
| branches: | |
| - "*" | |
| permissions: | |
| contents: read | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
| DOTNET_NOLOGO: true | |
| NuGetDirectory: ${{github.workspace}}/nuget | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| create_nuget: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Get all the history so MinGit can compute the version | |
| - name: Set up latest .NET 10.0 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - run: dotnet pack NGitLab.sln --configuration Release --output ${{env.NuGetDirectory}} /bl | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: nuget | |
| if-no-files-found: error | |
| retention-days: 7 | |
| path: ${{env.NuGetDirectory}}/**/* | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: binlogs | |
| if-no-files-found: error | |
| retention-days: 7 | |
| path: "**/*.binlog" | |
| build_and_test: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| TestResultsDirectory: ${{github.workspace}}/TestResults | |
| strategy: | |
| matrix: | |
| gitlab: | |
| # Keep in sync with the version in GitLabDockerContainer.cs | |
| # Available tags: https://hub.docker.com/r/gitlab/gitlab-ee/tags | |
| - "gitlab/gitlab-ee:16.11.10-ee.0" | |
| - "gitlab/gitlab-ee:17.1.8-ee.0" | |
| configuration: [Release] | |
| fail-fast: false | |
| services: | |
| gitlab: | |
| image: ${{matrix.gitlab}} | |
| ports: | |
| - 48624:48624 | |
| env: | |
| GITLAB_OMNIBUS_CONFIG: "external_url 'http://localhost:48624/'" | |
| GITLAB_ROOT_PASSWORD: "Pa$$w0rd" | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up latest .NET 10.0 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Set artifact name | |
| id: set-artifact-name | |
| run: | | |
| $value = "${{matrix.gitlab}}-${{matrix.configuration}}".Replace(':', '-').Replace('/', '-') | |
| "artifact_name=test-results-$value" >> $env:GITHUB_OUTPUT | |
| - name: Run tests | |
| run: dotnet test --configuration ${{matrix.configuration}} --logger trx --results-directory "${{env.TestResultsDirectory}}" --collect:"XPlat Code Coverage" /p:RunAnalyzers=false | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v6 | |
| if: always() | |
| with: | |
| name: ${{steps.set-artifact-name.outputs.artifact_name}} | |
| if-no-files-found: error | |
| retention-days: 3 | |
| path: ${{env.TestResultsDirectory}}/**/* | |
| - name: Test Report | |
| uses: dorny/test-reporter@v2 | |
| if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork && (success() || failure()) | |
| with: | |
| name: test-results-${{steps.set-artifact-name.outputs.artifact_name}} | |
| path: ${{env.TestResultsDirectory}}/**/*.trx | |
| path-replace-backslashes: "true" | |
| reporter: dotnet-trx | |
| deploy: | |
| runs-on: ubuntu-22.04 | |
| needs: [create_nuget, build_and_test] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: nuget | |
| path: ${{env.NuGetDirectory}} | |
| - name: Set up latest .NET 10.0 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Publish NuGet packages | |
| run: | | |
| Write-Host "Current ref: $env:GITHUB_REF" | |
| Write-Host "Searching nupkg in folder: ${{env.NuGetDirectory}}" | |
| $files = Get-ChildItem "${{env.NuGetDirectory}}/*" -Include *.nupkg | |
| foreach ($file in $files) { | |
| if ($env:GITHUB_REF -clike 'refs/tags/*') | |
| { | |
| Write-Host "Pushing NuGet package: $($file.FullName)" | |
| & dotnet nuget push "$($file.FullName)" --api-key "${{secrets.NUGET_APIKEY}}" --source https://api.nuget.org/v3/index.json --force-english-output --skip-duplicate | |
| } | |
| else | |
| { | |
| Write-Host "Not on a tag => Do not push: $($file.FullName)" | |
| } | |
| } |