Skip to content

Commit

Permalink
try enforce msbuild version on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Mar 4, 2025
1 parent 90ea6be commit 5481712
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/nugetTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- '**'
tags-ignore:
- '**'
# Triggers the workflow on labeled PRs only.
pull_request_target:
types: [ labeled ]

Expand All @@ -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
Expand Down

0 comments on commit 5481712

Please sign in to comment.