openclaw/scripts/ios-release-plan.sh
Josh Avant 8c6fbf5f89
feat(ios): distribute daily TestFlight builds for external testing (#161460)
* feat(ios): distribute daily TestFlight builds for external testing

* fix(ios): reuse App Store builds for first TestFlight distribution

Recognize the App Store-selected build of the same recorded source when it is eligible for beta submission and has no beta notes. Freeze its identity and notes and stage it without another archive or upload. Verify the adopted build ID and preserve existing beta notes on recovery.

The CLI and registered Fastlane regression cases fail before the correction. The complete two-file suite passes 43 cases; the noted-store recovery guard also passes. Script and affected root-test types, scoped lint, formatting, and independent P0-P2 review pass.
2026-09-29 20:43:46 -05:00

38 lines
1.2 KiB
Bash

#!/bin/bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage:
scripts/ios-release-plan.sh [--json] [--destination app-store|testflight] [--version 2026.7.2] [--revision 1] [--build-number 3]
Reads App Store Connect state and prints the deterministic iOS release plan.
This command does not mutate App Store Connect or repository files.
EOF
}
BUILD_NUMBER=""
APP_STORE_REVISION=""
RELEASE_VERSION=""
RELEASE_DESTINATION=""
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${ROOT_DIR}/scripts/lib/ios-fastlane.sh"
parse_ios_release_args plan "$@"
PLAN_FILE="$(mktemp "${TMPDIR:-/tmp}/openclaw-ios-release-plan.XXXXXX")"
trap 'rm -f "${PLAN_FILE}"' EXIT
FASTLANE_ARGS=(ios release_plan "output_path:${PLAN_FILE}")
[[ -n "${RELEASE_DESTINATION}" ]] && FASTLANE_ARGS+=("destination:${RELEASE_DESTINATION}")
[[ -n "${RELEASE_VERSION}" ]] && FASTLANE_ARGS+=("release_version:${RELEASE_VERSION}")
[[ -n "${APP_STORE_REVISION}" ]] && FASTLANE_ARGS+=("app_store_revision:${APP_STORE_REVISION}")
[[ -n "${BUILD_NUMBER}" ]] && FASTLANE_ARGS+=("build_number:${BUILD_NUMBER}")
if ! (
cd "${ROOT_DIR}/apps/ios"
run_ios_fastlane "${FASTLANE_ARGS[@]}" 1>&2
); then
echo "Failed to resolve the iOS release plan." >&2
exit 1
fi
cat "${PLAN_FILE}"