From 58979725287583f6ac612606b6a62e1de7307d9c Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 23 Jul 2024 08:26:01 +0100 Subject: [PATCH 1/2] Set DOTNET_INSTALL_DIR Try setting `DOTNET_INSTALL_DIR` as a workaround to .NET SDK issue. --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1624b614..92c493ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: # HACK Workaround for https://github.com/dotnet/sdk/issues/42211 - name: Update .NET Aspire workload - if: runner.os == 'Windows' + if: false && runner.os == 'Windows' shell: pwsh run: | $manifest = @' @@ -47,12 +47,20 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 + # HACK Workaround for https://github.com/dotnet/sdk/issues/42211 + - name: Set DOTNET_INSTALL_DIR + if: runner.os == 'Windows' + shell: pwsh + run: | + "DOTNET_INSTALL_DIR=${env:DOTNET_ROOT}" >> ${env:GITHUB_ENV} + - name: Build, Test and Publish id: build shell: pwsh run: ./build.ps1 env: DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_INSTALL_DIR: ${{ env.DOTNET_INSTALL_DIR }} DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 NUGET_XMLDOC_MODE: skip From a84a818cdf258e955e81dd4d15892cb40a19d868 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Tue, 23 Jul 2024 14:43:11 +0100 Subject: [PATCH 2/2] Set DOTNET_INSTALL_DIR before install Set the environment variable before running setup-dotnet. --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92c493ab..36d99be5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,18 +41,19 @@ jobs: dotnet workload update --advertising-manifests-only && ` dotnet workload update --from-rollback-file $manifestPath + - name: Set DOTNET_INSTALL_DIR + if: runner.os == 'Windows' + shell: pwsh + run: | + "DOTNET_INSTALL_DIR=${env:GITHUB_WORKSPACE}\.dotnet" >> ${env:GITHUB_ENV} + - name: Checkout code uses: actions/checkout@v4 - name: Setup .NET SDK uses: actions/setup-dotnet@v4 - - # HACK Workaround for https://github.com/dotnet/sdk/issues/42211 - - name: Set DOTNET_INSTALL_DIR - if: runner.os == 'Windows' - shell: pwsh - run: | - "DOTNET_INSTALL_DIR=${env:DOTNET_ROOT}" >> ${env:GITHUB_ENV} + env: + DOTNET_INSTALL_DIR: ${{ env.DOTNET_INSTALL_DIR }} - name: Build, Test and Publish id: build @@ -60,7 +61,6 @@ jobs: run: ./build.ps1 env: DOTNET_CLI_TELEMETRY_OPTOUT: true - DOTNET_INSTALL_DIR: ${{ env.DOTNET_INSTALL_DIR }} DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 NUGET_XMLDOC_MODE: skip