diff --git a/.github/workflows/amicode-release.yml b/.github/workflows/amicode-release.yml index a1980b441..b89fc97d5 100644 --- a/.github/workflows/amicode-release.yml +++ b/.github/workflows/amicode-release.yml @@ -54,9 +54,26 @@ jobs: check() { local BIN="$1" test -f "$BIN" - # minified shape: `...general?.newLayoutDesigns,)` with `=!0` (on) / `=!1` (off) + # Shape A (current, since ead3274d3 "lock down appearance settings; force v2 layout"): + # settings.tsx sets `newLayoutDesigns: createMemo(() => true)` — unconditional, no + # channel dependency. Minifies to `newLayoutDesigns:(()=>!0)`. + if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!0)' "$BIN"; then + echo "OK: gate hardcoded ON (unconditional memo) in $BIN" + return 0 + fi + # `if`, not `grep && { ... }` — under `set -e` a failing grep in an AND-list aborts + # the step with no message, which would silently pass as a green gate. + if grep -aq 'newLayoutDesigns:[A-Za-z$_]\{1,8\}(()=>!1)' "$BIN"; then + echo "FAIL: unconditional memo is OFF (=>!1) in $BIN" + exit 1 + fi + # Shape B (legacy, channel-gated): `...general?.newLayoutDesigns,)` with + # `=!0` (on) / `=!1` (off). Kept so this check still works if the setting is + # ever wired back to the channel default. local VAR - VAR=$(grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" | head -1 | sed 's/newLayoutDesigns,//; s/)//') + # `|| true` — under `set -o pipefail` a no-match grep would abort the step here with + # no message, so the "pattern not found" diagnostic below could never fire. + VAR=$( { grep -aoh 'newLayoutDesigns,[A-Za-z$_]\{1,8\})' "$BIN" || true; } | head -1 | sed 's/newLayoutDesigns,//; s/)//') test -n "$VAR" || { echo "FAIL: gate pattern not found in $BIN (minifier drift? update this check)"; exit 1; } grep -aq "[^A-Za-z0-9_\$]${VAR}=!0" "$BIN" \ || { echo "FAIL: channel gate OFF (${VAR}=!1) in $BIN — built with channel latest/prod?"; exit 1; }