cargo-binstall/.github/scripts/pack-release-archives.sh
Jiahao XU 75d2fc4d42
Optimize pre-built artifact size: Set compression level for zip to 9 (max) (#596)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2022-12-09 15:14:37 +13:00

17 lines
320 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
for o in outputs/*; do
pushd "$o"
chmod +x cargo-binstall*
target=$(basename "$o" | cut -d. -f1)
if grep -qE '(apple|windows)' <<< "$target"; then
zip -9 "../cargo-binstall-${target}.zip" *
else
tar cv * | gzip -9 > "../cargo-binstall-${target}.tgz"
fi
popd
done