Slim release packaging
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-21 11:21:05 -04:00
parent 29d894b43b
commit b21c2eed9d
4 changed files with 53 additions and 12 deletions
+36 -4
View File
@@ -36,6 +36,7 @@ else
versioned_artifact="dosh-$version-$os-$arch.tar.gz"
fi
stage="$out_dir/stage/dosh"
write_versioned="${DOSH_PACKAGE_VERSIONED:-0}"
if [ "$os" = "windows" ]; then
cargo build --release --bin dosh-client --bin dosh-bench
@@ -57,6 +58,30 @@ if [ -f "$stage/bin/dosh-client.exe" ]; then
elif [ -f "$stage/bin/dosh-client" ]; then
cp "$stage/bin/dosh-client" "$stage/bin/dosh"
fi
strip_bin() {
file="$1"
[ -f "$file" ] || return 0
case "$file" in
*.exe)
if command -v x86_64-w64-mingw32-strip >/dev/null 2>&1; then
x86_64-w64-mingw32-strip "$file" 2>/dev/null || true
elif command -v strip >/dev/null 2>&1; then
strip "$file" 2>/dev/null || true
fi
;;
*)
if command -v strip >/dev/null 2>&1; then
strip "$file" 2>/dev/null || true
fi
;;
esac
}
for bin in "$stage"/bin/*; do
strip_bin "$bin"
done
printf '%s\n' "$version" >"$stage/VERSION"
if [ "$os" = "windows" ]; then
@@ -71,8 +96,6 @@ if [ "$os" = "windows" ]; then
else
tar -C "$out_dir/stage" -czf "$out_dir/$artifact" dosh
fi
cp "$out_dir/$artifact" "$out_dir/$versioned_artifact"
write_sha256() {
file="$1"
if command -v sha256sum >/dev/null 2>&1; then
@@ -85,12 +108,21 @@ write_sha256() {
}
write_sha256 "$out_dir/$artifact"
write_sha256 "$out_dir/$versioned_artifact"
if [ "$write_versioned" = "1" ]; then
cp "$out_dir/$artifact" "$out_dir/$versioned_artifact"
write_sha256 "$out_dir/$versioned_artifact"
fi
printf 'Wrote:\n'
cat <<EOF
Wrote:
$out_dir/$artifact
$out_dir/$artifact.sha256
EOF
if [ "$write_versioned" = "1" ]; then
cat <<EOF
$out_dir/$versioned_artifact
$out_dir/$versioned_artifact.sha256
EOF
fi