#!/usr/bin/env bash # One round, end to end: the mock walk, then the phone (the embedded build, # installed, walked on the real core), then the commit — each step gated on # the one before, so nothing lands on the phone the mock did not pass and # nothing is committed the phone did not pass. # # bash src-tauri/android/ship.sh [commit-message-file] # # The phone walk needs the phone attached with SoulStream (or the launcher) # on screen; SS_ALBUM / SS_QUERY name the record and the search it uses. set -uo pipefail cd /f/Coding/SoulStream MSG="${1:-}" T="$(cygpath -u "$TEMP")" ADB="$(cygpath -u "$LOCALAPPDATA")/Android/Sdk/platform-tools/adb.exe" stamp=$(date +%H%M%S) ALBUM="${SS_ALBUM:-Spiderman}" QUERY="${SS_QUERY:-daft punk}" echo "== mock walk $(date +%T)" if ! node tests/mobile/smoke.mjs > "$T/ss-ship-mock-$stamp.log" 2>&1; then echo "MOCK WALK FAILED ($T/ss-ship-mock-$stamp.log)" grep -n "FAIL" "$T/ss-ship-mock-$stamp.log" | cut -c1-160 | head sed -n '/problem(s):/,$p' "$T/ss-ship-mock-$stamp.log" | cut -c1-300 | head -20 exit 1 fi echo " green" echo "== deploy $(date +%T)" if ! bash src-tauri/android/deploy.sh > "$T/ss-ship-deploy-$stamp.log" 2>&1; then echo "DEPLOY FAILED ($T/ss-ship-deploy-$stamp.log)" tail -25 "$T/ss-ship-deploy-$stamp.log" exit 1 fi grep -a "^== install\|Success\|not launched" "$T/ss-ship-deploy-$stamp.log" | tail -3 echo "== phone walk $(date +%T)" if ! node tests/mobile/smoke.mjs --phone --album "$ALBUM" --query "$QUERY" > "$T/ss-ship-phone-$stamp.log" 2>&1; then echo "PHONE WALK FAILED ($T/ss-ship-phone-$stamp.log)" grep -n "FAIL" "$T/ss-ship-phone-$stamp.log" | cut -c1-160 | head sed -n '/problem(s):/,$p' "$T/ss-ship-phone-$stamp.log" | cut -c1-300 | head -20 "$ADB" forward --remove-all exit 1 fi grep -n "audio \|no exceptions" "$T/ss-ship-phone-$stamp.log" | cut -c1-120 "$ADB" forward --remove-all if [ -n "$MSG" ]; then echo "== commit $(date +%T)" git add -A git -c user.name="KeelrLeek" commit -q -F "$MSG" 2>/dev/null git log -1 --format=' %h %s' | cut -c1-140 fi echo "== shipped $(date +%T)"