Files
openclaw/scripts/ios-configure-signing.sh
Nimrod Gutman 98962ed81d feat(ios): auto-select local signing team (#18421)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: bbb9c3aa48
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Co-authored-by: ngutman <1540134+ngutman@users.noreply.github.com>
Reviewed-by: @ngutman
2026-02-18 03:16:10 +08:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
IOS_DIR="${ROOT_DIR}/apps/ios"
TEAM_ID_SCRIPT="${ROOT_DIR}/scripts/ios-team-id.sh"
LOCAL_SIGNING_FILE="${IOS_DIR}/.local-signing.xcconfig"
if [[ ! -x "${TEAM_ID_SCRIPT}" ]]; then
echo "ERROR: Missing team detection helper: ${TEAM_ID_SCRIPT}" >&2
exit 1
fi
team_id=""
if team_id="$("${TEAM_ID_SCRIPT}" 2>/dev/null)"; then
:
else
if [[ "${IOS_SIGNING_REQUIRED:-0}" == "1" ]]; then
"${TEAM_ID_SCRIPT}"
exit 1
fi
echo "WARN: Unable to detect an Apple Team ID; keeping existing iOS signing override (if any)." >&2
exit 0
fi
tmp_file="$(mktemp "${TMPDIR:-/tmp}/openclaw-ios-signing.XXXXXX")"
cat >"${tmp_file}" <<EOF
// Auto-generated by scripts/ios-configure-signing.sh.
// This file is local-only and should not be committed.
OPENCLAW_IOS_SELECTED_TEAM = ${team_id}
EOF
if [[ -f "${LOCAL_SIGNING_FILE}" ]] && cmp -s "${tmp_file}" "${LOCAL_SIGNING_FILE}"; then
rm -f "${tmp_file}"
echo "iOS signing team already configured: ${team_id}"
exit 0
fi
mv "${tmp_file}" "${LOCAL_SIGNING_FILE}"
echo "Configured iOS signing team: ${team_id}"