cacher

S3-backed CI cache helper. A single static Go binary.

What it is

cacher is the build that the typical "check S3, fall back to upstream, upload for next time" shell loop should have been. It downloads, uploads, lists, and invalidates cached artifacts in any S3-compatible bucket — single files, docker images (via streamed save | zstd | s3), and whole directory trees keyed by lockfile hash. Built for builds.sr.ht; works anywhere you can run a binary and reach an S3 endpoint.

Download

Pre-built binaries for v0.2.2. The shipping URL is stable; the SHA-256s below are specific to this build — paste them into your pin if you care.

PlatformBinarySHA-256
linux/amd64 cacher-linux-amd64 310165e2765d9834fc8b56011d4e4b4fb49805722dc674a4e65c506b51d4e168
linux/arm64 cacher-linux-arm64 6490a9b7ecc7a5bf843ec5d49251bbd97a89cad8e8837233e5d0f7d45698c33d
darwin/amd64 cacher-darwin-amd64 323176428bf2e53c3f81bcfafe03252d9692b1dc97b91c592d51a26b53c5b3bd
darwin/arm64 cacher-darwin-arm64 8300cc4c27f5529164f2ef5a3a788cd140ae86b26f8fef103900d2335aa9d4bb

The install.sh bootstrap picks the right asset for the host, verifies it against checksums.txt, and installs into ~/.local/bin — on builds.sr.ht it also appends the PATH export to ~/.buildenv, so a CI manifest needs exactly one line:

curl -sSL https://bigbes.pages.srht.bigb.es/ci-cacher/install.sh | sh

By hand, all four hashes plus filenames are also available in a single checksums.txt for piping into sha256sum -c:

wget https://bigbes.pages.srht.bigb.es/ci-cacher/cacher-linux-amd64 \
  -O ~/.local/bin/cacher
chmod +x ~/.local/bin/cacher
wget -qO- https://bigbes.pages.srht.bigb.es/ci-cacher/checksums.txt \
  | sha256sum -c --ignore-missing

The loop it replaces

# before — install awscli, write ~/.aws/config, then in every task:
if aws s3api head-object --bucket "$B" --key "$K" >/dev/null 2>&1; then
  aws s3 cp "s3://$B/$K" "$out"
else
  curl -sSL "$url" -o "$out"
  aws s3 cp "$out" "s3://$B/$K"
fi
# after — one binary, one config, one command:
cacher download "$key" "$out" --url "$url"

Commands

Run cacher --help for the full surface. Read the README for usage patterns, Garage compatibility notes, and exit-code semantics.

Why

The shell version this replaced repeated five things in every CI task: install AWS CLI v2 (≈50 MB per build), write a Garage-tuned ~/.aws/config, compute cache keys from file content with sha256sum | cut, branch HIT/MISS by hand, and for docker images pipe docker save | zstd | aws s3 cp - (and the inverse). cacher collapses all of that into one fetched binary plus a config file. The directory caching is the genuinely new capability — the shell version only ever handled single files.

Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.2.2 — 2026-08-07

Fixed

0.2.1 — 2026-08-07

Fixed

0.2.0 — 2026-08-07

Added

0.1.2 — 2026-05-26

Changed

0.1.1 — 2026-05-26

Added

Changed

0.1.0 — 2026-05-26

First public release. Replaces the s3_cache_or_curl / s3_cache_docker_image shell helpers in tarantool-protobuf/.builds/lib/ci-lib.sh with a single static Go binary.

Added

Fixed

This build

Version
v0.2.2
Built
2026-08-06T22:19:49Z
Source
git.srht.bigb.es/~bigbes/ci-cacher
License
BSD-2-Clause