bread-ecosystem/scripts
Breadway 4c70a837fc gen-index: serialize concurrent runs, unique tmp files
Every repo's dev-release / beta-release workflow runs this script after its
build. Two merges landing in the same round (breadbar + breadbox this week)
run it concurrently on the one self-hosted runner, both writing
`${OUT}.tmp` in the shared output dir. The second `mv "${OUT}.tmp" "${OUT}"`
then fails "No such file or directory" — the first run already consumed it —
and `set -e` turns that into a red publish job, even though the index was
written correctly by the other run.

That's the whole reason breadbar's dev-release (run 126, the shell-theme
publish) showed red and the theme-capable binary looked unpublished.

- flock a per-track lock for the whole run, so the two invocations serialize
  and the later one also sees the earlier's fresh `latest` symlink.
- mktemp -u the index.json / .minisig temp paths so even an unlocked caller
  (INDEX_LOCK override, older workflow) can't collide.

Verified: two concurrent runs against a fake DL tree both exit 0 with one
consistent index.json and no leftover .tmp.
2026-09-01 14:30:03 +08:00
..
cleanup-old-mirror-workflows.sh Add push-mirror provisioning + old mirror.yml cleanup scripts 2026-07-17 14:11:30 +08:00
doctor-channels.sh scripts: add onboard-product.sh, teach doctor-channels.sh to check signing secrets 2026-08-05 18:54:25 +08:00
gen-index.sh gen-index: serialize concurrent runs, unique tmp files 2026-09-01 14:30:03 +08:00
gen-readme-products.sh platform: BreadClient command/health, fail-closed get.sh, registry README 2026-08-15 21:39:08 +08:00
get.sh platform: BreadClient command/health, fail-closed get.sh, registry README 2026-08-15 21:39:08 +08:00
onboard-product.sh scripts: add onboard-product.sh, teach doctor-channels.sh to check signing secrets 2026-08-05 18:54:25 +08:00
setup-push-mirrors.sh Add push-mirror provisioning + old mirror.yml cleanup scripts 2026-07-17 14:11:30 +08:00
test-gen-index.sh Fix audit findings: bakery index signing, artifact checksums, stale theme docs 2026-07-17 03:37:51 +08:00