Update .NET version in release pipeline to 11.x and include preview version #5084
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: Gated-Ubuntu | |
| on: | |
| push: | |
| branches: | |
| - 'releases/**' | |
| - dev | |
| pull_request: | |
| branches: | |
| - 'releases/**' | |
| - dev | |
| jobs: | |
| build_ubuntu: | |
| runs-on: ubuntu-latest | |
| env: | |
| EMULATOR_VERSION: '1.6.1' | |
| strategy: | |
| fail-fast: false # Disable the auto cancelling of all in-progress and queued jobs in the matrix if any job in the matrix fails. | |
| matrix: | |
| dotnet-version: [ '8.0.x' ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| filters: | | |
| src: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'build/**' | |
| - 'samples/**' | |
| - '*.cmd' | |
| - '*.ps1' | |
| - '**.props' | |
| - '**.csproj' | |
| - '**.targets' | |
| - '*.sh' | |
| - '*.sln' | |
| emulator: | |
| - 'src/Microsoft.Azure.SignalR.Emulator/.dockerignore' | |
| - 'src/Microsoft.Azure.SignalR.Emulator/Dockerfile' | |
| - name: Update SubModules | |
| run: git submodule update --init --recursive | |
| if: steps.filter.outputs.src == 'true' | |
| - name: Setup dotnet ${{ matrix.dotnet-version }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| # Remove it when .NET 11 is GA. | |
| - name: Setup .NET 11 daily SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '11.0.x' | |
| dotnet-quality: 'daily' | |
| - name: Display dotnet version | |
| run: dotnet --version | |
| - name: Build emulator container | |
| run: | | |
| context="${RUNNER_TEMP}/emulator-container" | |
| mkdir -p "${context}/packages" | |
| cp src/Microsoft.Azure.SignalR.Emulator/Dockerfile "${context}" | |
| cp src/Microsoft.Azure.SignalR.Emulator/.dockerignore "${context}" | |
| curl --fail --location --silent --show-error \ | |
| "https://api.nuget.org/v3-flatcontainer/microsoft.azure.signalr.emulator/${EMULATOR_VERSION}/microsoft.azure.signalr.emulator.${EMULATOR_VERSION}.nupkg" \ | |
| --output "${context}/packages/Microsoft.Azure.SignalR.Emulator.${EMULATOR_VERSION}.nupkg" | |
| docker build \ | |
| --build-arg "EMULATOR_FEED=/context/packages" \ | |
| --build-arg "EMULATOR_VERSION=${EMULATOR_VERSION}" \ | |
| --file "${context}/Dockerfile" \ | |
| --tag signalr-emulator:ci \ | |
| "${context}" | |
| docker run --rm --entrypoint sh signalr-emulator:ci \ | |
| -c "test -d /root/.dotnet/tools/.store/microsoft.azure.signalr.emulator/${EMULATOR_VERSION}" | |
| version_output="$(docker run --rm --entrypoint asrs-emulator signalr-emulator:ci --version)" | |
| case "${version_output}" in | |
| "${EMULATOR_VERSION}"|"${EMULATOR_VERSION}-"*|"${EMULATOR_VERSION}+"*) ;; | |
| *) echo "Unexpected emulator version: ${version_output}" >&2; exit 1 ;; | |
| esac | |
| docker run --rm --entrypoint asrs-emulator signalr-emulator:ci --help | |
| container_id="$(docker run --detach --publish 127.0.0.1::8888 signalr-emulator:ci)" | |
| trap 'docker rm --force "${container_id}" >/dev/null 2>&1 || true' EXIT | |
| host_port="$(docker port "${container_id}" 8888/tcp | awk -F: '{print $NF}')" | |
| for attempt in {1..30}; do | |
| if curl --fail --silent --show-error "http://127.0.0.1:${host_port}/api/health"; then | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| docker logs "${container_id}" | |
| exit 1 | |
| if: steps.filter.outputs.emulator == 'true' | |
| - name: Build with dotnet | |
| run: "dotnet build AzureSignalR.sln /p:DisableNet461Tests=true" | |
| if: steps.filter.outputs.src == 'true' | |
| - name: Test | |
| run: dotnet test --no-build --logger trx --results-directory "TestResults-ubuntu-${{ matrix.dotnet-version }}" | |
| - name: Upload dotnet test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dotnet-results-${{ matrix.dotnet-version }} | |
| path: TestResults-ubuntu-${{ matrix.dotnet-version }} | |
| # Use always() to always run this step to publish test results when there are test failures | |
| if: ${{ always() }} |