commit 3f224cd918c04385cc4966f45d990cc56026f6f7
parent 11d83003757e99a5939c0875e7dcd9396c13154d
Author: Michael Camilleri <[email protected]>
Date: Thu, 14 May 2026 07:47:51 +0900
Add upload-only script
Recently, publishing can fail due to issues on Apple's servers. This
adds an upload-only script so that a build doesn't need to be compiled.
Co-Authored-By: Codex GPT 5.5 <[email protected]>
Diffstat:
2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/Scripts/publish-ios.sh b/Scripts/publish-ios.sh
@@ -50,6 +50,8 @@ cleanup_keychain() {
security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
security default-keychain -d user -s ~/Library/Keychains/login.keychain-db
security delete-keychain "$TMP_KEYCHAIN" 2>/dev/null || true
+ rm -f "$REPO_ROOT/private_keys/AuthKey_${KEY_ID}.p8"
+ rmdir "$REPO_ROOT/private_keys" 2>/dev/null || true
}
trap cleanup_keychain EXIT
@@ -123,7 +125,5 @@ xcrun iTMSTransporter \
-apiKey "$KEY_ID" \
-apiIssuer "$ISSUER_ID" \
-v informational
-rm -f "$REPO_ROOT/private_keys/AuthKey_${KEY_ID}.p8"
-rmdir "$REPO_ROOT/private_keys" 2>/dev/null || true
echo "==> Done!"
diff --git a/Scripts/upload-ios.sh b/Scripts/upload-ios.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -euo pipefail
+
+REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+SECRETS="$REPO_ROOT/.asc/secrets.sh"
+IPA_PATH="${1:-/tmp/Crossmate-export/Crossmate.ipa}"
+
+if [[ ! -f "$SECRETS" ]]; then
+ echo "Error: $SECRETS not found. See Scripts/secrets.sh.example for the required format."
+ exit 1
+fi
+
+if [[ ! -f "$IPA_PATH" ]]; then
+ echo "Error: IPA not found at $IPA_PATH"
+ echo "Run Scripts/publish-ios.sh --check first, or pass an IPA path:"
+ echo " bash Scripts/upload-ios.sh /path/to/Crossmate.ipa"
+ exit 1
+fi
+
+source "$SECRETS"
+
+cd "$REPO_ROOT"
+
+mkdir -p "$REPO_ROOT/private_keys"
+cp "$REPO_ROOT/.asc/AuthKey_${KEY_ID}.p8" "$REPO_ROOT/private_keys/"
+
+cleanup_key() {
+ rm -f "$REPO_ROOT/private_keys/AuthKey_${KEY_ID}.p8"
+ rmdir "$REPO_ROOT/private_keys" 2>/dev/null || true
+}
+trap cleanup_key EXIT
+
+echo "==> Uploading $IPA_PATH to App Store Connect..."
+xcrun iTMSTransporter \
+ -m upload \
+ -assetFile "$IPA_PATH" \
+ -apiKey "$KEY_ID" \
+ -apiIssuer "$ISSUER_ID" \
+ -v informational
+
+echo "==> Done!"