From 0b46f8c8da7e5479bc8a9db10a5d9200c70d19ef Mon Sep 17 00:00:00 2001 From: leemour Date: Thu, 8 Oct 2026 23:37:32 +0200 Subject: [PATCH] chore(release): one release at a time on this machine bin/release takes a machine-wide flock before any npm or gh call and holds it until the publish finishes; a second release, in any of the packages, is refused with who holds it. The release workflow gets a concurrency group so two runs never publish at once. Co-Authored-By: Claude Opus 5.5 (1M context) --- bin/release | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/release b/bin/release index 0caeb9e..45b92ed 100755 --- a/bin/release +++ b/bin/release @@ -27,6 +27,8 @@ git merge -q --ff-only origin/main [ "$(git rev-parse HEAD)" = "$before" ] || exec "$0" "$@" # The workflow publishes origin/main, so a local commit not pushed yet would silently not ship. [ "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)" ] || { echo "main is ahead of origin/main — push first" >&2; exit 1; } +# One release at a time on this machine, across every package: two sessions published at once on 2026-10-08. +lock="${XDG_RUNTIME_DIR:-/tmp}/leemour-release.lock"; exec 9>"$lock"; flock -n 9 || { echo "another release is running: $(cat "$lock.who" 2>/dev/null)" >&2; exit 1; }; echo "$(basename "$PWD") pid $$ since $(date -u +%H:%M)" > "$lock.who" version=$(node -p 'require("./package.json").version') # Only the top section: the rename below must never touch one that is already published.