this repo has no description
at main 38 lines 1.2 kB view raw
1#!/usr/bin/env bash 2set -euo pipefail 3 4PREV_TAG=${1:?"pass previous release tag (e.g. v0.1.0)"} 5CUR_TAG=${2:?"pass current release tag (e.g. v0.1.1)"} 6 7ROOT=$(cd "$(dirname "$0")/.." && pwd) 8PREV_VER=${PREV_TAG#v} 9APP_NAME="RepoBar" 10 11ZIP_URL="https://github.com/steipete/RepoBar/releases/download/${PREV_TAG}/${APP_NAME}-${PREV_VER}.zip" 12TMP_DIR=$(mktemp -d /tmp/repobar-live.XXXX) 13trap 'rm -rf "$TMP_DIR"' EXIT 14 15echo "Downloading previous release $PREV_TAG from $ZIP_URL" 16curl -L -o "$TMP_DIR/prev.zip" "$ZIP_URL" 17 18echo "Installing previous release to /Applications/${APP_NAME}.app" 19rm -rf /Applications/${APP_NAME}.app 20ditto -x -k "$TMP_DIR/prev.zip" "$TMP_DIR" 21ditto "$TMP_DIR/${APP_NAME}.app" /Applications/${APP_NAME}.app 22 23echo "Launching previous build…" 24open -n /Applications/${APP_NAME}.app 25sleep 4 26 27cat <<'MSG' 28Manual step: trigger "Check for Updates…" in the app and install the update. 29Expect to land on the newly released version. When done, confirm below. 30MSG 31 32read -rp "Did the update succeed from ${PREV_TAG} to ${CUR_TAG}? (y/N) " answer 33if [[ ! "$answer" =~ ^[Yy]$ ]]; then 34 echo "Live update test NOT confirmed; failing per RUN_SPARKLE_UPDATE_TEST." >&2 35 exit 1 36fi 37 38echo "Live update test confirmed."