12# CI for src.rest: ./release.sh --check, the local release gate (locked installs,3# generated types, static checks, tests, editor and docs builds, Worker dry runs).4set -eu56# release.sh needs Node.js 24 or newer. If the first node on PATH is older,7# put the directory of the first one that is new enough ahead of it.8node_major() { "$1" -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0; }9if [ "$(node_major node)" -lt 24 ]; then10 IFS=:11 for dir in $PATH; do12 if [ -x "$dir/node" ] && [ "$(node_major "$dir/node")" -ge 24 ]; then13 PATH=$dir:$PATH14 break15 fi16 done17 unset IFS18 export PATH19fi2021# release.sh only runs from the main branch, and forge attest checks out a22# detached HEAD, so run it in a throwaway clone with main at this commit.23commit=$(git rev-parse HEAD)24tmp=$(mktemp -d)25trap 'rm -rf "$tmp"' EXIT26git clone -q --shared --no-checkout . "$tmp/diagramzip"27cd "$tmp/diagramzip"28git checkout -q -B main "$commit"2930# The shell Worker's tests serve apps/editor/dist through its asset binding,31# and release.sh builds the editor only after the tests, so build it first,32# as it already is in a working checkout.33npm ci --no-audit --no-fund34npm run build:editor3536./release.sh --check