soul-browser/scripts/soulamz-stamp.sh
KaKi87 acbe0401f1
Skip redundant CI rebuilds for soulamz and tooling (#85)
* Skip redundant CI rebuilds for soulamz and OCR/WARP tooling.

Refresh soulamz.inputs so prebuilts match current inputs, track OCR/WARP
dex in git with tooling.inputs, build soulamz ABIs in parallel, and drop
Actions tooling cache in favor of checkout prebuilts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Make soulamz and tooling input stamps path-independent.

sha256sum was hashing absolute file paths, so CI and local machines
computed different values and always rebuilt prebuilts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Store OCR/WARP dex prebuilts under prebuilts/ for reliable CI checkout.

Gitignored tools/ and bundled-ocr/ paths were not always restored on CI
runners. Relocate dex artifacts to a normal tracked directory and keep
using path-independent input stamps.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Use .dat extension for tracked OCR/WARP prebuilts.

Global *.dex gitignore was preventing reliable checkout on CI runners;
store dex bytes as .dat files instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Log why OCR/WARP tooling prebuilts are rebuilt on CI.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Hash prebuilt inputs from file contents only.

Filename-bearing sha256sum output still diverged between CI and local
machines for tooling sources; aggregate raw bytes instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Debug tooling stamp at start of build step

Co-authored-by: Cursor <cursoragent@cursor.com>

* Hash prebuilt inputs with git hash-object for CI parity.

Working-tree byte hashes differed on GitHub runners; git blob hashes
match the committed tree on every checkout.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Hash prebuilt inputs from git tree blob ids.

Use ls-tree blob hashes so checkout line-ending filters cannot skew
the stamp on CI runners.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 08:10:34 +02:00

34 lines
765 B
Bash
Executable file

#!/usr/bin/env bash
# Hash soulamz build inputs; skip rebuild when sources and build script are unchanged.
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
INPUTS_FILE="${ROOT_DIR}/bundled-warp/soulamz.inputs"
soulamz_stamp_hash() {
(
cd "${ROOT_DIR}"
git ls-tree HEAD \
native/soulamz/main.go \
native/soulamz/go.mod \
native/soulamz/go.sum \
scripts/build-soulamz.sh \
| awk '{print $3}' \
| sha256sum | awk '{print $1}'
)
}
case "${1:-hash}" in
hash)
soulamz_stamp_hash
;;
write)
mkdir -p "$(dirname "${INPUTS_FILE}")"
soulamz_stamp_hash > "${INPUTS_FILE}"
echo "Wrote ${INPUTS_FILE}"
;;
*)
echo "usage: $0 [hash|write]" >&2
exit 1
;;
esac