From 9b47bcd48151573a6cd7f345da22e1b173f7a757 Mon Sep 17 00:00:00 2001 From: Jonathan Borgwing Date: Sat, 18 Jul 2026 15:12:49 -0400 Subject: [PATCH] fix: launch app directly in Homebrew smoke --- .github/workflows/finalize-release.yml | 17 +++++++++-------- scripts/smoke-formula.sh | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/finalize-release.yml b/.github/workflows/finalize-release.yml index ea6ff23..f1c5bef 100644 --- a/.github/workflows/finalize-release.yml +++ b/.github/workflows/finalize-release.yml @@ -75,15 +75,16 @@ jobs: tail -200 "$(brew --prefix)/var/log/microbridge.log" || true exit 1 fi - open -n "$APP" - APP_PID="" - for _ in {1..30}; do - APP_PID="$(pgrep -f "$APP/Contents/MacOS/" | head -1 || true)" - [[ -n "$APP_PID" ]] && break - sleep 1 - done - test -n "$APP_PID" + APP_LOG="$RUNNER_TEMP/microbridge-app.log" + "$APP/Contents/MacOS/microbridge-ui" >"$APP_LOG" 2>&1 & + APP_PID=$! + sleep 3 + if ! kill -0 "$APP_PID"; then + cat "$APP_LOG" + exit 1 + fi kill "$APP_PID" || true + wait "$APP_PID" || true brew services stop DevVig/microbridge/microbridge HOMEBREW_NO_INSTALL_CLEANUP=1 brew uninstall DevVig/microbridge/microbridge if brew services list | grep -q '^microbridge[[:space:]]'; then diff --git a/scripts/smoke-formula.sh b/scripts/smoke-formula.sh index 53832cd..b174a8e 100755 --- a/scripts/smoke-formula.sh +++ b/scripts/smoke-formula.sh @@ -10,6 +10,7 @@ EXPECTED_ARCH="${3:?usage: $0 path/to/microbridge.rb VERSION ARCH}" TAP="devvig/microbridge-ci" APP="$HOME/Applications/Microbridge.app" BREW_LOG="$(brew --prefix)/var/log/microbridge.log" +APP_LOG="${RUNNER_TEMP:-/tmp}/microbridge-app.log" cleanup() { brew services stop "$TAP/microbridge" >/dev/null 2>&1 || true @@ -27,6 +28,10 @@ diagnostics() { echo "==> $BREW_LOG" >&2 tail -200 "$BREW_LOG" >&2 || true fi + if [[ -f "$APP_LOG" ]]; then + echo "==> $APP_LOG" >&2 + tail -200 "$APP_LOG" >&2 || true + fi if [[ -d "$APP" ]]; then echo "==> Installed app bundle" >&2 find "$APP/Contents" -maxdepth 2 -type f -print >&2 || true @@ -75,15 +80,12 @@ for _ in {1..30}; do done test "$SERVICE_STATE" = "started" || test "$SERVICE_STATE" = "scheduled" -open -n "$APP" -APP_PID="" -for _ in {1..30}; do - APP_PID="$(pgrep -f "$APP/Contents/MacOS/" | head -1 || true)" - [[ -n "$APP_PID" ]] && break - sleep 1 -done -test -n "$APP_PID" +"$APP/Contents/MacOS/microbridge-ui" >"$APP_LOG" 2>&1 & +APP_PID=$! +sleep 3 +kill -0 "$APP_PID" kill "$APP_PID" || true +wait "$APP_PID" || true brew services stop "$TAP/microbridge" HOMEBREW_NO_INSTALL_CLEANUP=1 brew uninstall "$TAP/microbridge"