Skip to content

Commit b53d6f4

Browse files
committed
fix(release): verify PowerShell PATH uses the pinned runtime
1 parent 30137e9 commit b53d6f4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎.github/workflows/release-desktop.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ jobs:
137137
shell: powershell
138138
run: |
139139
$ErrorActionPreference = "Stop"
140+
$ProgressPreference = "SilentlyContinue"
140141
$version = "7.4.20"
141142
$archive = Join-Path $env:RUNNER_TEMP "PowerShell-$version-win-arm64.zip"
142143
$installDir = Join-Path $env:RUNNER_TEMP "powershell-$version-arm64"
@@ -148,10 +149,19 @@ jobs:
148149
throw "PowerShell archive checksum mismatch"
149150
}
150151
Expand-Archive -Path $archive -DestinationPath $installDir
151-
$installDir >> $env:GITHUB_PATH
152+
$installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
152153
& "$installDir\pwsh.exe" -NoProfile -NonInteractive -Command '$PSVersionTable; [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture'
153154
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
154155
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+
155165
# Windows installs straight from the registry. There, linking the packages
156166
# takes the time, not downloading them, so a ~700 MB package cache did not
157167
# pay for its own restore. Across recent nightlies, restore plus install

0 commit comments

Comments
 (0)