Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/18573/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 1 changed file with 33 additions and 0 deletions.

x
0 of 1 viewed, 1 left
33 additions and 0 deletions.github/workflows/release-desktop.ymlModified
View file
@@ -129,6 +129,39 @@
git sparse-checkout set --no-cone '/*' '!/.repos/'
git -c checkout.workers=0 checkout --detach FETCH_HEAD
​
+ # The runner's PowerShell 7.6/.NET 10 intermittently crashes during signing:
+ # https://github.com/dotnet/runtime/issues/131636
+ # Put the .NET 8 release first for both workflow shells and electron-builder.
+ - name: Use PowerShell 7.4 for Windows ARM builds
+ if: inputs.platform == 'win' && inputs.arch == 'arm64'
+ shell: powershell
+ run: |
+ $ErrorActionPreference = "Stop"
+ $ProgressPreference = "SilentlyContinue"
+ $version = "7.4.20"
+ $archive = Join-Path $env:RUNNER_TEMP "PowerShell-$version-win-arm64.zip"
+ $installDir = Join-Path $env:RUNNER_TEMP "powershell-$version-arm64"
+ Invoke-WebRequest -UseBasicParsing `
+ -Uri "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-arm64.zip" `
+ -OutFile $archive
+ $expectedHash = "67eff749d5dae357501c95a3eec1dcd93f669824e3ca2b1d2adcdecdebf04f35"
+ if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne $expectedHash) {
+ throw "PowerShell archive checksum mismatch"
+ }
+ Expand-Archive -Path $archive -DestinationPath $installDir
+ $installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+ & "$installDir\pwsh.exe" -NoProfile -NonInteractive -Command '$PSVersionTable; [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture'
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+​
+ - name: Verify Windows ARM PowerShell selection
+ if: inputs.platform == 'win' && inputs.arch == 'arm64'