@@ -129,6 +129,39 @@ jobs:
129129 git sparse-checkout set --no-cone '/*' '!/.repos/'
130130 git -c checkout.workers=0 checkout --detach FETCH_HEAD
131131
132+ # The runner's PowerShell 7.6/.NET 10 intermittently crashes during signing:
133+ # https://github.com/dotnet/runtime/issues/131636
134+ # Put the .NET 8 release first for both workflow shells and electron-builder.
135+ - name : Use PowerShell 7.4 for Windows ARM builds
136+ if : inputs.platform == 'win' && inputs.arch == 'arm64'
137+ shell : powershell
138+ run : |
139+ $ErrorActionPreference = "Stop"
140+ $ProgressPreference = "SilentlyContinue"
141+ $version = "7.4.20"
142+ $archive = Join-Path $env:RUNNER_TEMP "PowerShell-$version-win-arm64.zip"
143+ $installDir = Join-Path $env:RUNNER_TEMP "powershell-$version-arm64"
144+ Invoke-WebRequest -UseBasicParsing `
145+ -Uri "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-arm64.zip" `
146+ -OutFile $archive
147+ $expectedHash = "67eff749d5dae357501c95a3eec1dcd93f669824e3ca2b1d2adcdecdebf04f35"
148+ if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne $expectedHash) {
149+ throw "PowerShell archive checksum mismatch"
150+ }
151+ Expand-Archive -Path $archive -DestinationPath $installDir
152+ $installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
153+ & "$installDir\pwsh.exe" -NoProfile -NonInteractive -Command '$PSVersionTable; [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture'
154+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
155+
156+ - name : Verify Windows ARM PowerShell selection
157+ if : inputs.platform == 'win' && inputs.arch == 'arm64'
158+ shell : pwsh
159+ run : |
160+ $expectedPath = Join-Path $env:RUNNER_TEMP "powershell-7.4.20-arm64\pwsh.exe"
161+ if ((Get-Command pwsh.exe).Source -ne $expectedPath -or $PSVersionTable.PSVersion -ne [version]"7.4.20") {
162+ throw "Windows ARM builds must use the pinned PowerShell runtime"
163+ }
164+
132165 # Windows installs straight from the registry. There, linking the packages
133166 # takes the time, not downloading them, so a ~700 MB package cache did not
134167 # pay for its own restore. Across recent nightlies, restore plus install
0 commit comments