Skip to content

Commit 815fc51

Browse files
committed
* Use windows-2025-vs2026 and improve msbuild check
Update build and release workflows to run on windows-2025-vs2026. Improve the diagnostics step: explicitly use pwsh, broaden MSBuild.exe lookup to handle nested Visual Studio folders, fallback to msbuild if available, and otherwise note that dotnet build will be used. Applied consistently in .github/workflows/build.yml and .github/workflows/release.yml.
1 parent eb80f4b commit 815fc51

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
build:
1616
name: Build Toolkit
17-
runs-on: windows-latest
17+
runs-on: windows-2025-vs2026
1818

1919
strategy:
2020
matrix:
@@ -65,11 +65,15 @@ jobs:
6565
"@ | Out-File -Encoding utf8 global.json
6666
6767
- name: Print diagnostics
68+
shell: pwsh
6869
run: |
6970
dotnet --list-sdks
7071
dotnet --info
71-
$msbuild = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\*\MSBuild\Current\Bin\MSBuild.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
72-
if ($msbuild) { & $msbuild.FullName -version } else { msbuild -version 2>$null; if (-not $?) { Write-Output "msbuild not found (using dotnet build instead)" } }
72+
if (Get-Command msbuild -ErrorAction SilentlyContinue) {
73+
msbuild -version
74+
} else {
75+
Write-Output "msbuild not found (using dotnet build instead)"
76+
}
7377
7478
# Use the non-NuGet solution so projects use ProjectReference to Standard-Toolkit (no Krypton.Standard.Toolkit package on nuget.org)
7579
- name: Restore using dotnet

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
jobs:
2828
build-and-release:
2929
name: Build and Release Toolkit
30-
runs-on: windows-latest
30+
runs-on: windows-2025-vs2026
3131

3232
steps:
3333
- name: Checkout repository
@@ -70,11 +70,15 @@ jobs:
7070
"@ | Out-File -Encoding utf8 global.json
7171
7272
- name: Print diagnostics
73+
shell: pwsh
7374
run: |
7475
dotnet --list-sdks
7576
dotnet --info
76-
$msbuild = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\*\MSBuild\Current\Bin\MSBuild.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
77-
if ($msbuild) { & $msbuild.FullName -version } else { msbuild -version 2>$null; if (-not $?) { Write-Output "msbuild not found (using dotnet build instead)" } }
77+
if (Get-Command msbuild -ErrorAction SilentlyContinue) {
78+
msbuild -version
79+
} else {
80+
Write-Output "msbuild not found (using dotnet build instead)"
81+
}
7882
7983
- name: Determine Configuration
8084
id: config

0 commit comments

Comments
 (0)