diff --git a/.github/workflows/nugetTests.yml b/.github/workflows/nugetTests.yml index fd8ee9ca1..a05b5a985 100644 --- a/.github/workflows/nugetTests.yml +++ b/.github/workflows/nugetTests.yml @@ -6,7 +6,6 @@ on: - '**' tags-ignore: - '**' - # Triggers the workflow on labeled PRs only. pull_request_target: types: [ labeled ] @@ -30,18 +29,39 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - # Prepare ubuntu by installing Mono and handle dotnet installation issues. + # Unified Windows Setup: MSBuild 17.12 + Environment Fixes + - name: Setup Windows Environment (MSBuild 17.12) + if: matrix.os == 'windows' + run: | + echo "🔧 Uninstalling existing MSBuild..." + choco uninstall visualstudio2022buildtools -y + + echo "🚀 Installing MSBuild 17.12..." + choco install visualstudio2022buildtools --version=17.2.4.32902 -y --force + choco install visualstudio2022-workload-vctools -y + + echo "🔧 Setting MSBuild PATH..." + echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\17.12\bin" >> $GITHUB_PATH + + echo "🚀 Applying MSBuild 17.13+ Workaround..." + echo "MSBUILDDISABLEFEATURESFROMVERSION=17.14" >> $GITHUB_ENV + + echo "✅ Windows environment setup completed!" + + echo "🔍 Checking Installed MSBuild Version:" + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\17.12\bin\msbuild.exe" -version + shell: pwsh + + # Prepare ubuntu by installing Mono and handling dotnet installation issues. - name: Prepare ubuntu if: matrix.os == 'ubuntu' run: | - # Install Mono sudo apt-get update sudo apt-get install -y apt-transport-https dirmngr gnupg ca-certificates sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list sudo apt-get update sudo apt-get install -y mono-complete - # Fixes dotnet installation issues, see https://github.com/jfrog/jfrog-cli/pull/2808 for more details. echo "DOTNET_INSTALL_DIR=/usr/share/dotnet" >> $GITHUB_ENV sudo mkdir -p /usr/share/dotnet sudo chmod 777 /usr/share/dotnet