authorgravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-10-12 00:59:37-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-12 00:59:37-07:00
log5d59e7107f5db834e1746e9b1f66f6bdeb404496
treea242b5dfe2db813945f9d046afef55f2acedd776
parentd83929ad0bb0d4aec800f12c332de57e873cc7e5
signature Signed by PGP key B5690EEEBB952194

fix(release): avoid PowerShell crashes on Windows ARM (#18573)


1 files changed, 33 insertions(+), 0 deletions(-)

.github/workflows/release-desktop.yml+33
...@@ -129,6 +129,39 @@ jobs:...@@ -129,6 +129,39 @@ jobs:
129 git sparse-checkout set --no-cone '/*' '!/.repos/'129 git sparse-checkout set --no-cone '/*' '!/.repos/'
130 git -c checkout.workers=0 checkout --detach FETCH_HEAD130 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
132 # Windows installs straight from the registry. There, linking the packages165 # Windows installs straight from the registry. There, linking the packages
133 # takes the time, not downloading them, so a ~700 MB package cache did not166 # takes the time, not downloading them, so a ~700 MB package cache did not
134 # pay for its own restore. Across recent nightlies, restore plus install167 # pay for its own restore. Across recent nightlies, restore plus install