Build Size Gate — CI Check for Build Size Regressions


Fail CI when your build grows past a committed baseline. Editor window + headless gate, three size metrics, and an artifact-level diff that shows which packaged files actually grew.


by HanoStudio


Price History +

Every team has shipped this bug: the build was 40 MB last release, and somehow it's 55 MB now. Nobody noticed, because nobody was watching every merge.


Build Size Gate watches every merge.


It compares each build against a small, versioned JSON baseline and fails CI (non-zero exit code) when the build grows past your thresholds — absolute bytes or percent, warn or fail, per metric.


BUILT ON PUBLISHED, REPRODUCIBLE MEASUREMENTS

This tool came out of a public experiment series: 16 Android APKs, one variable changed at a time, every number published with raw data and a reproducible project. The methodology — and its open-source measurement engine — is documented at hellohanostudio.github.io.


THREE METRICS, NOT ONE

"Build size" is not one number. The gate checks three:

• artifact bytes — the file users download

• BuildReport total size — Unity's reported output

• packed asset bytes — serialized asset data

An APK can be stable while assets move, and assets can be stable while generated code grows. Gating all three catches both.


THE WINDOW (Tools ▸ Build Size Gate ▸ Open Window)

• Gate — run the check in the Editor: PASS/WARN/FAIL banner, per-metric deltas with reasons, and one-click "Approve Current Build" when growth is intentional.

• Baselines — capture a baseline from any build summary and edit thresholds in plain fields. No hand-edited JSON.

• Layers — compare two APK/AAB files entry by entry and see exactly which packaged files grew (libil2cpp.so, global-metadata.dat — the growth asset reports cannot attribute). Export CSV.

• CI Setup — generates a ready-to-run shell command and a GitHub Actions workflow with your paths filled in.


WORKS OUT OF THE BOX

A sample baseline and build summary are included — open the window and see a real check pass in under a minute, before your first build. After that: build once, capture, commit the JSON, done.


HONEST SCOPE (v1)

Built and validated on Android APK builds with Unity 6000.3 (IL2CPP/ARM64). The gate itself is platform-agnostic and reads a plain-text summary; iOS and AAB validation is on the roadmap. Editor-only — nothing ships in your player build.


Support: hellohanostudio@gmail.com