Skip to content

Commit 689ce59

Browse files
tonychang04claude
andauthored
perf(install): gzip binaries (~60MB → ~20MB) + progress already shown (#38)
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 <asset>.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. Claude-Session: https://claude.ai/code/session_01GMbAe5K1RfwaAcge5inX7P Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent c9abc40 commit 689ce59

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ jobs:
6161
with:
6262
path: dist-bin
6363
merge-multiple: true # flatten all per-target artifacts into one dir
64-
- name: Checksums
64+
- name: Checksums + compress
6565
run: |
6666
cd dist-bin
67+
# Checksum the RAW binaries first — install.sh verifies the DECOMPRESSED artifact
68+
# (what actually runs), so SHA256SUMS lists raw-binary hashes.
6769
sha256sum insta-* > SHA256SUMS
70+
# gzip the unix binaries (~60MB → ~20MB download). Leave the Windows .exe raw
71+
# (manual download). install.sh fetches <asset>.gz and gunzips.
72+
for f in insta-darwin-* insta-linux-*; do gzip -f "$f"; done
6873
ls -lh
6974
cat SHA256SUMS
7075
- name: Resolve tag

install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@ fi
8282
tmp="$(mktemp -d)"
8383
trap 'rm -rf "$tmp"' EXIT
8484

85-
echo "Installing $BIN ($asset, $version) — downloading ~60MB…"
86-
# --progress-bar (not -s): the binary is ~60MB, so a silent download looks frozen. Show progress
87-
# to a TTY; stay quiet when piped without one. Keep the tiny SHA256SUMS fetch silent.
85+
# --progress-bar (not -s): a silent download looks frozen. Show progress to a TTY; stay quiet
86+
# when piped without one. Keep the tiny SHA256SUMS fetch silent.
8887
if [ -t 2 ]; then dl="curl -fL --progress-bar"; else dl="curl -fsSL"; fi
89-
$dl "$base/$asset" -o "$tmp/$BIN" || { echo "error: download failed ($base/$asset)" >&2; exit 1; }
88+
# Prefer the gzipped asset (~3× smaller); fall back to the raw binary for older releases.
89+
if curl -fsSL -I "$base/$asset.gz" >/dev/null 2>&1; then
90+
echo "Installing $BIN ($asset, $version) — downloading ~20MB…"
91+
$dl "$base/$asset.gz" -o "$tmp/$BIN.gz" || { echo "error: download failed ($base/$asset.gz)" >&2; exit 1; }
92+
gunzip "$tmp/$BIN.gz" || { echo "error: could not decompress $asset.gz" >&2; exit 1; }
93+
else
94+
echo "Installing $BIN ($asset, $version) — downloading ~60MB…"
95+
$dl "$base/$asset" -o "$tmp/$BIN" || { echo "error: download failed ($base/$asset)" >&2; exit 1; }
96+
fi
9097
curl -fsSL "$base/SHA256SUMS" -o "$tmp/SHA256SUMS" || { echo "error: could not fetch SHA256SUMS" >&2; exit 1; }
9198

9299
# ---- verify checksum ----

0 commit comments

Comments
 (0)