Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/amicode-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,26 @@ jobs:
check() {
local BIN="$1"
test -f "$BIN"
# minified shape: `...general?.newLayoutDesigns,<VAR>)` with `<VAR>=!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:<F>(()=>!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,<VAR>)` with
# `<VAR>=!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; }
Expand Down
Loading