@@ -33,36 +33,50 @@ jobs:
33
33
with :
34
34
nuget-version : ' 5.x'
35
35
36
- # 4. Restore Dependencies
36
+ # 4. Set MSBuild Path (for .NET Framework)
37
+ - name : Set MSBuild Path
38
+ if : contains(matrix.framework, 'v')
39
+ shell : pwsh
40
+ run : |
41
+ Write-Host "🔧 Setting MSBuild path for .NET Framework..."
42
+ $msbuildPath = &"C:\Program Files\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
43
+ if (-not $msbuildPath) {
44
+ Write-Error "❌ MSBuild not found!"
45
+ exit 1
46
+ }
47
+ Write-Host "✅ MSBuild found at: $msbuildPath"
48
+ echo "MSBUILD_PATH=$msbuildPath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8
49
+
50
+ # 5. Restore Dependencies
37
51
- name : Restore Dependencies
38
52
shell : pwsh
39
53
run : |
40
54
Write-Host "🔄 Restoring dependencies for: ${{ matrix.framework }}"
41
55
if ("${{ matrix.framework }}" -notlike "v*") { dotnet restore }
42
56
if ("${{ matrix.framework }}" -like "v*") { nuget.exe restore CloudinaryDotNet.sln }
43
57
44
- # 5 . Build Solution
58
+ # 6 . Build Solution
45
59
- name : Build Solution
46
60
shell : pwsh
47
61
run : |
48
62
Write-Host "⚒️ Building for: ${{ matrix.framework }}"
49
63
if ("${{ matrix.framework }}" -notlike "v*") { dotnet build --configuration Release --no-restore }
50
- if ("${{ matrix.framework }}" -like "v*") { msbuild CloudinaryDotNet.sln /p:Configuration=Release /p:TargetFrameworkVersion=${{ matrix.framework }} }
64
+ if ("${{ matrix.framework }}" -like "v*") { & $env:MSBUILD_PATH CloudinaryDotNet.sln /p:Configuration=Release /p:TargetFrameworkVersion=${{ matrix.framework }} }
51
65
52
- # 6 . Run before_build.ps1
66
+ # 7 . Run before_build.ps1
53
67
- name : Run before_build.ps1
54
68
shell : pwsh
55
69
run : . ./before_build.ps1
56
70
57
- # 7 . Run Unit Tests
71
+ # 8 . Run Unit Tests
58
72
- name : Run Unit Tests
59
73
shell : pwsh
60
74
run : |
61
75
Write-Host "🧪 Running Unit Tests for: ${{ matrix.framework }}"
62
76
if ("${{ matrix.framework }}" -notlike "v*") { dotnet test "./CloudinaryDotNet.Tests/CloudinaryDotNet.Tests.csproj" --configuration Release --no-build }
63
77
if ("${{ matrix.framework }}" -like "v*") { vstest.console.exe "./CloudinaryDotNet.Tests/bin/Release/${{ matrix.framework }}/CloudinaryDotNet.Tests.dll" /Framework:${{ matrix.framework }} }
64
78
65
- # 8 . Run Integration Tests
79
+ # 9 . Run Integration Tests
66
80
- name : Run Integration Tests
67
81
shell : pwsh
68
82
run : |
0 commit comments