Make Windows packaging find PowerShell hosts
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / macos-client (macos-aarch64, macos-14) (push) Canceled after 0s
ci / macos-client (macos-x86_64, macos-13) (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest, , , ) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14, , , ) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13, , , ) (push) Canceled after 0s
ci / package-release (windows-aarch64, windows-latest, aarch64, windows, aarch64-pc-windows-msvc) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest, , , ) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-16 21:07:36 -04:00
parent dba8e0197d
commit 5ebabfc674
2 changed files with 22 additions and 3 deletions
+13 -3
View File
@@ -125,6 +125,16 @@ strip_bin() {
esac
}
powershell_compress_archive() {
for ps in powershell.exe powershell pwsh.exe pwsh; do
if command -v "$ps" >/dev/null 2>&1; then
"$ps" -NoProfile -Command "Compress-Archive -Force -Path '$stage' -DestinationPath '$out_dir/$artifact'"
return 0
fi
done
return 1
}
for bin in "$stage"/bin/*; do
strip_bin "$bin"
done
@@ -132,12 +142,12 @@ done
printf '%s\n' "$version" >"$stage/VERSION"
if [ "$os" = "windows" ]; then
if command -v powershell.exe >/dev/null 2>&1; then
powershell.exe -NoProfile -Command "Compress-Archive -Force -Path '$stage' -DestinationPath '$out_dir/$artifact'"
if powershell_compress_archive; then
:
elif command -v zip >/dev/null 2>&1; then
(cd "$out_dir/stage" && zip -qr "../$artifact" dosh)
else
echo "windows packaging requires powershell.exe or zip" >&2
echo "windows packaging requires PowerShell or zip" >&2
exit 1
fi
else