Skip to content

Commit efcee0d

Browse files
committed
ci(github workflows): Replace manual search for MSBuild with official setup action
- Remove the customized MSBuild path lookup script - Use microsoft/setup-msbuild@v2 to automatically configure the MSBuild environment - Simplify the build steps by directly invoking the build using the msbuild command
1 parent d0a9f71 commit efcee0d

1 file changed

Lines changed: 5 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -209,41 +209,25 @@ jobs:
209209
$manifestContent = $manifestContent -replace '\$ARCHITECTURE\$', "x64"
210210
Set-Content $manifestPath -Value $manifestContent -Encoding UTF8
211211
212-
- name: Find MSBuild
213-
id: find-msbuild
214-
shell: pwsh
215-
run: |
216-
$msbuildPaths = @(
217-
"C:\Program Files\Microsoft Visual Studio\2026\Enterprise\MSBuild\Current\Bin\MSBuild.exe",
218-
"C:\Program Files\Microsoft Visual Studio\2026\Professional\MSBuild\Current\Bin\MSBuild.exe",
219-
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe",
220-
"C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
221-
)
222-
$msbuild = $msbuildPaths | Where-Object { Test-Path $_ } | Select-Object -First 1
223-
if ($msbuild) {
224-
Write-Host "MSBuild found: $msbuild"
225-
"MSBUILD=$msbuild" >> $env:GITHUB_OUTPUT
226-
} else {
227-
Write-Error "MSBuild not found in expected locations"
228-
exit 1
229-
}
212+
- name: Setup MSBuild
213+
uses: microsoft/setup-msbuild@v2
230214

231215
- name: Build MSIX x64
232216
run: |
233217
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="x64"' | Set-Content "DevTools.Package\Package.appxmanifest"
234-
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x64 /p:AppxPackageDir=AppPackages\x64\
218+
msbuild DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x64 /p:AppxPackageDir=AppPackages\x64\
235219
shell: pwsh
236220

237221
- name: Build MSIX x86
238222
run: |
239223
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="x86"' | Set-Content "DevTools.Package\Package.appxmanifest"
240-
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x86 /p:AppxPackageDir=AppPackages\x86\
224+
msbuild DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x86 /p:AppxPackageDir=AppPackages\x86\
241225
shell: pwsh
242226

243227
- name: Build MSIX arm64
244228
run: |
245229
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="arm64"' | Set-Content "DevTools.Package\Package.appxmanifest"
246-
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=arm64 /p:AppxPackageDir=AppPackages\arm64\
230+
msbuild DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=arm64 /p:AppxPackageDir=AppPackages\arm64\
247231
shell: pwsh
248232

249233
- name: Show output

0 commit comments

Comments
 (0)