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
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:
@@ -125,6 +125,16 @@ strip_bin() {
|
|||||||
esac
|
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
|
for bin in "$stage"/bin/*; do
|
||||||
strip_bin "$bin"
|
strip_bin "$bin"
|
||||||
done
|
done
|
||||||
@@ -132,12 +142,12 @@ done
|
|||||||
printf '%s\n' "$version" >"$stage/VERSION"
|
printf '%s\n' "$version" >"$stage/VERSION"
|
||||||
|
|
||||||
if [ "$os" = "windows" ]; then
|
if [ "$os" = "windows" ]; then
|
||||||
if command -v powershell.exe >/dev/null 2>&1; then
|
if powershell_compress_archive; then
|
||||||
powershell.exe -NoProfile -Command "Compress-Archive -Force -Path '$stage' -DestinationPath '$out_dir/$artifact'"
|
:
|
||||||
elif command -v zip >/dev/null 2>&1; then
|
elif command -v zip >/dev/null 2>&1; then
|
||||||
(cd "$out_dir/stage" && zip -qr "../$artifact" dosh)
|
(cd "$out_dir/stage" && zip -qr "../$artifact" dosh)
|
||||||
else
|
else
|
||||||
echo "windows packaging requires powershell.exe or zip" >&2
|
echo "windows packaging requires PowerShell or zip" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -391,6 +391,15 @@ fn package_release_maps_windows_cross_arch_targets() {
|
|||||||
assert!(package.contains("aarch64-pc-windows-msvc"));
|
assert!(package.contains("aarch64-pc-windows-msvc"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn package_release_windows_zip_tries_classic_and_core_powershell() {
|
||||||
|
let package = include_str!("../scripts/package-release.sh");
|
||||||
|
assert!(package.contains("powershell_compress_archive()"));
|
||||||
|
assert!(package.contains("for ps in powershell.exe powershell pwsh.exe pwsh; do"));
|
||||||
|
assert!(package.contains("\"$ps\" -NoProfile -Command"));
|
||||||
|
assert!(package.contains("windows packaging requires PowerShell or zip"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn systemd_service_does_not_sandbox_remote_shells() {
|
fn systemd_service_does_not_sandbox_remote_shells() {
|
||||||
let service = include_str!("../packaging/systemd/dosh-server.service");
|
let service = include_str!("../packaging/systemd/dosh-server.service");
|
||||||
|
|||||||
Reference in New Issue
Block a user