Skip to content

Commit e1a1b14

Browse files
ci: use a more generic way of finding mt.exe
This sets up a vs developer command prompt and should hopefully should be more resilient to upstream changes Co-authored-by: David Gumberg <[email protected]>
1 parent 7ae0497 commit e1a1b14

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ jobs:
211211
steps:
212212
- *CHECKOUT
213213

214-
- name: Set up VS Developer Prompt
214+
- &SET_UP_VS
215+
name: Set up VS Developer Prompt
215216
shell: pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'"
216217
run: |
217218
$vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
@@ -374,19 +375,14 @@ jobs:
374375
- name: Run bitcoind.exe
375376
run: ./bin/bitcoind.exe -version
376377

377-
- name: Find mt.exe tool
378-
shell: pwsh
379-
run: |
380-
$sdk_dir = (Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' -Name KitsRoot10).KitsRoot10
381-
$sdk_latest = (Get-ChildItem "$sdk_dir\bin" -Directory | Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | Sort-Object Name -Descending | Select-Object -First 1).Name
382-
"MT_EXE=${sdk_dir}bin\${sdk_latest}\x64\mt.exe" >> $env:GITHUB_ENV
378+
- *SET_UP_VS
383379

384380
- name: Get bitcoind manifest
385381
shell: pwsh
386382
run: |
387-
& $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
383+
mt.exe -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
388384
Get-Content bitcoind.manifest
389-
& $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -validate_manifest
385+
mt.exe -nologo -inputresource:bin\bitcoind.exe -validate_manifest
390386
391387
- name: Run unit tests
392388
# Can't use ctest here like other jobs as we don't have a CMake build tree.

0 commit comments

Comments
 (0)