Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
188 lines
4.4 KiB
Bash
Executable File
188 lines
4.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
usage() {
|
|
cat <<'EOF'
|
|
Usage:
|
|
scripts/ios-app-store-connect-keychain-setup.sh --key-path /path/to/AuthKey_XXXXXX.p8 --issuer-id <issuer-uuid> [options]
|
|
|
|
Required:
|
|
--key-path <path> Path to App Store Connect API key (.p8)
|
|
--issuer-id <uuid> App Store Connect issuer ID
|
|
|
|
Optional:
|
|
--key-id <id> API key ID (auto-detected from AuthKey_<id>.p8 if omitted)
|
|
--service <name> Keychain service name (default: openclaw-app-store-connect-key)
|
|
--account <name> Keychain account name (default: $USER or $LOGNAME)
|
|
--write-env Upsert non-secret env vars into apps/ios/fastlane/.env
|
|
--env-file <path> Override env file path used with --write-env
|
|
-h, --help Show this help
|
|
|
|
Example:
|
|
scripts/ios-app-store-connect-keychain-setup.sh \
|
|
--key-path "$HOME/keys/AuthKey_ABC1234567.p8" \
|
|
--issuer-id "00000000-1111-2222-3333-444444444444" \
|
|
--write-env
|
|
EOF
|
|
}
|
|
|
|
upsert_env_line() {
|
|
local file="$1"
|
|
local key="$2"
|
|
local value="$3"
|
|
local tmp
|
|
tmp="$(mktemp)"
|
|
|
|
if [[ -f "$file" ]]; then
|
|
awk -v key="$key" -v value="$value" '
|
|
BEGIN { updated = 0 }
|
|
$0 ~ ("^" key "=") { print key "=" value; updated = 1; next }
|
|
{ print }
|
|
END { if (!updated) print key "=" value }
|
|
' "$file" >"$tmp"
|
|
else
|
|
printf "%s=%s\n" "$key" "$value" >"$tmp"
|
|
fi
|
|
|
|
mv "$tmp" "$file"
|
|
}
|
|
|
|
delete_env_line() {
|
|
local file="$1"
|
|
local key="$2"
|
|
local tmp
|
|
tmp="$(mktemp)"
|
|
|
|
if [[ ! -f "$file" ]]; then
|
|
rm -f "$tmp"
|
|
return
|
|
fi
|
|
|
|
awk -v key="$key" '
|
|
$0 ~ ("^" key "=") { next }
|
|
{ print }
|
|
' "$file" >"$tmp"
|
|
|
|
mv "$tmp" "$file"
|
|
}
|
|
|
|
KEY_PATH=""
|
|
KEY_ID=""
|
|
ISSUER_ID=""
|
|
SERVICE="openclaw-app-store-connect-key"
|
|
ACCOUNT="${USER:-${LOGNAME:-}}"
|
|
WRITE_ENV=0
|
|
ENV_FILE=""
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
DEFAULT_ENV_FILE="$REPO_ROOT/apps/ios/fastlane/.env"
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case "$1" in
|
|
--key-path)
|
|
KEY_PATH="${2:-}"
|
|
shift 2
|
|
;;
|
|
--key-id)
|
|
KEY_ID="${2:-}"
|
|
shift 2
|
|
;;
|
|
--issuer-id)
|
|
ISSUER_ID="${2:-}"
|
|
shift 2
|
|
;;
|
|
--service)
|
|
SERVICE="${2:-}"
|
|
shift 2
|
|
;;
|
|
--account)
|
|
ACCOUNT="${2:-}"
|
|
shift 2
|
|
;;
|
|
--write-env)
|
|
WRITE_ENV=1
|
|
shift
|
|
;;
|
|
--env-file)
|
|
ENV_FILE="${2:-}"
|
|
shift 2
|
|
;;
|
|
-h|--help)
|
|
usage
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Unknown argument: $1" >&2
|
|
usage
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [[ -z "$KEY_PATH" || -z "$ISSUER_ID" ]]; then
|
|
echo "Missing required arguments." >&2
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "$KEY_PATH" ]]; then
|
|
echo "Key file not found: $KEY_PATH" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "$KEY_ID" ]]; then
|
|
key_filename="$(basename "$KEY_PATH")"
|
|
if [[ "$key_filename" =~ ^AuthKey_([A-Za-z0-9]+)\.p8$ ]]; then
|
|
KEY_ID="${BASH_REMATCH[1]}"
|
|
else
|
|
echo "Could not infer --key-id from filename '$key_filename'. Pass --key-id explicitly." >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
if [[ -z "$ACCOUNT" ]]; then
|
|
echo "Could not determine Keychain account. Pass --account explicitly." >&2
|
|
exit 1
|
|
fi
|
|
|
|
KEY_CONTENT="$(cat "$KEY_PATH")"
|
|
if [[ -z "$KEY_CONTENT" ]]; then
|
|
echo "Key file is empty: $KEY_PATH" >&2
|
|
exit 1
|
|
fi
|
|
|
|
security add-generic-password \
|
|
-a "$ACCOUNT" \
|
|
-s "$SERVICE" \
|
|
-w "$KEY_CONTENT" \
|
|
-U >/dev/null
|
|
|
|
echo "Stored App Store Connect API private key in macOS Keychain (service='$SERVICE', account='$ACCOUNT')."
|
|
echo
|
|
echo "Export these vars for Fastlane:"
|
|
echo "APP_STORE_CONNECT_KEY_ID=$KEY_ID"
|
|
echo "APP_STORE_CONNECT_ISSUER_ID=$ISSUER_ID"
|
|
echo "APP_STORE_CONNECT_KEYCHAIN_SERVICE=$SERVICE"
|
|
echo "APP_STORE_CONNECT_KEYCHAIN_ACCOUNT=$ACCOUNT"
|
|
|
|
if [[ "$WRITE_ENV" -eq 1 ]]; then
|
|
if [[ -z "$ENV_FILE" ]]; then
|
|
ENV_FILE="$DEFAULT_ENV_FILE"
|
|
fi
|
|
|
|
mkdir -p "$(dirname "$ENV_FILE")"
|
|
touch "$ENV_FILE"
|
|
|
|
upsert_env_line "$ENV_FILE" "APP_STORE_CONNECT_KEY_ID" "$KEY_ID"
|
|
upsert_env_line "$ENV_FILE" "APP_STORE_CONNECT_ISSUER_ID" "$ISSUER_ID"
|
|
upsert_env_line "$ENV_FILE" "APP_STORE_CONNECT_KEYCHAIN_SERVICE" "$SERVICE"
|
|
upsert_env_line "$ENV_FILE" "APP_STORE_CONNECT_KEYCHAIN_ACCOUNT" "$ACCOUNT"
|
|
# Remove file/path based keys so Keychain is used by default.
|
|
delete_env_line "$ENV_FILE" "APP_STORE_CONNECT_KEY_PATH"
|
|
delete_env_line "$ENV_FILE" "APP_STORE_CONNECT_KEY_CONTENT"
|
|
delete_env_line "$ENV_FILE" "APP_STORE_CONNECT_API_KEY_PATH"
|
|
|
|
echo
|
|
echo "Updated env file: $ENV_FILE"
|
|
fi
|