From 229b3fc3f75d9dee9c5815a758897c2bef594a01 Mon Sep 17 00:00:00 2001 From: yaowenc2 Date: Wed, 15 Jul 2026 09:50:25 +0800 Subject: [PATCH] =?UTF-8?q?perf(install):=20gzip=20binaries=20(~60MB=20?= =?UTF-8?q?=E2=86=92=20~20MB)=20+=20progress=20already=20shown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bun --compile embeds the full runtime, so each binary is ~60MB — the download looked frozen and was slow. release.yml now gzips the unix binaries (Bun compresses ~3×); install.sh fetches .gz and gunzips, with a raw-binary fallback for older releases. Checksums cover the DECOMPRESSED artifact (what runs), so integrity still verifies end-to-end. Windows .exe stays raw (manual download). Verified the gzip→verify flow locally. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GMbAe5K1RfwaAcge5inX7P --- .github/workflows/release.yml | 7 ++++++- install.sh | 15 +++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 715c29e..d86573a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,10 +61,15 @@ jobs: with: path: dist-bin merge-multiple: true # flatten all per-target artifacts into one dir - - name: Checksums + - name: Checksums + compress run: | cd dist-bin + # Checksum the RAW binaries first — install.sh verifies the DECOMPRESSED artifact + # (what actually runs), so SHA256SUMS lists raw-binary hashes. sha256sum insta-* > SHA256SUMS + # gzip the unix binaries (~60MB → ~20MB download). Leave the Windows .exe raw + # (manual download). install.sh fetches .gz and gunzips. + for f in insta-darwin-* insta-linux-*; do gzip -f "$f"; done ls -lh cat SHA256SUMS - name: Resolve tag diff --git a/install.sh b/install.sh index 36b6b2c..ac48dcf 100644 --- a/install.sh +++ b/install.sh @@ -82,11 +82,18 @@ fi tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT -echo "Installing $BIN ($asset, $version) — downloading ~60MB…" -# --progress-bar (not -s): the binary is ~60MB, so a silent download looks frozen. Show progress -# to a TTY; stay quiet when piped without one. Keep the tiny SHA256SUMS fetch silent. +# --progress-bar (not -s): a silent download looks frozen. Show progress to a TTY; stay quiet +# when piped without one. Keep the tiny SHA256SUMS fetch silent. if [ -t 2 ]; then dl="curl -fL --progress-bar"; else dl="curl -fsSL"; fi -$dl "$base/$asset" -o "$tmp/$BIN" || { echo "error: download failed ($base/$asset)" >&2; exit 1; } +# Prefer the gzipped asset (~3× smaller); fall back to the raw binary for older releases. +if curl -fsSL -I "$base/$asset.gz" >/dev/null 2>&1; then + echo "Installing $BIN ($asset, $version) — downloading ~20MB…" + $dl "$base/$asset.gz" -o "$tmp/$BIN.gz" || { echo "error: download failed ($base/$asset.gz)" >&2; exit 1; } + gunzip "$tmp/$BIN.gz" || { echo "error: could not decompress $asset.gz" >&2; exit 1; } +else + echo "Installing $BIN ($asset, $version) — downloading ~60MB…" + $dl "$base/$asset" -o "$tmp/$BIN" || { echo "error: download failed ($base/$asset)" >&2; exit 1; } +fi curl -fsSL "$base/SHA256SUMS" -o "$tmp/SHA256SUMS" || { echo "error: could not fetch SHA256SUMS" >&2; exit 1; } # ---- verify checksum ----