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 ----