Skip to content

Commit 55fc5e1

Browse files
committed
try build vsix
1 parent 0db0030 commit 55fc5e1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/build-vsix.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
14+
- name: Setup MSBuild (add to PATH)
15+
uses: microsoft/setup-msbuild@v2
1416
- name: Locate MSBuild
1517
id: msbuild
1618
shell: pwsh
1719
run: |
18-
$msbuild = & "$env:ProgramFiles(x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | Select-Object -First 1
20+
# 正确取 ProgramFiles(x86) 需要使用 ${env:ProgramFiles(x86)} 否则路径会变成 "Program Files(x86)"
21+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
22+
if(-not (Test-Path $vswhere)) { throw "vswhere not found at $vswhere" }
23+
$msbuild = & $vswhere -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" | Select-Object -First 1
1924
if(-not $msbuild){ throw 'MSBuild not found' }
20-
echo "path=$msbuild" >> $env:GITHUB_OUTPUT
25+
"path=$msbuild" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
2126
- name: Build VSIX (Release)
2227
shell: pwsh
2328
run: |

0 commit comments

Comments
 (0)