Skip to content

Commit 4246840

Browse files
committed
change to testflight_upload.sh shell script
1 parent 59b29d7 commit 4246840

File tree

5 files changed

+106
-67
lines changed

5 files changed

+106
-67
lines changed

Assets/CloudBuild.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
echo "=== TestFlight Upload Script Starting ==="
6+
7+
# Only upload if enabled
8+
if [ "$ENABLE_TESTFLIGHT_UPLOAD" != "TRUE" ]; then
9+
echo "ENABLE_TESTFLIGHT_UPLOAD != TRUE, skipping upload."
10+
exit 0
11+
fi
12+
13+
# Workspace (Unity Cloud Build sets this)
14+
WORKSPACE="${WORKSPACE:-}"
15+
16+
if [ -z "$WORKSPACE" ]; then
17+
echo "ERROR: WORKSPACE environment variable is not set."
18+
exit 1
19+
fi
20+
21+
echo "Workspace: $WORKSPACE"
22+
23+
24+
# ----------------------------
25+
# Locate IPA file
26+
# ----------------------------
27+
28+
IPA_DIR="$WORKSPACE/.build/last/ios-production"
29+
IPA_PATH="$IPA_DIR/build.ipa"
30+
31+
echo "Looking for IPA at: $IPA_PATH"
32+
33+
if [ ! -f "$IPA_PATH" ]; then
34+
echo "IPA not found directly. Searching recursively under workspace..."
35+
IPA_PATH=$(find "$WORKSPACE" -type f -name "*.ipa" | head -n 1)
36+
fi
37+
38+
if [ -z "$IPA_PATH" ]; then
39+
echo "ERROR: No IPA file found anywhere under $WORKSPACE"
40+
exit 1
41+
fi
42+
43+
echo "Using IPA file: $IPA_PATH"
44+
45+
46+
# ----------------------------
47+
# Write the .p8 key to disk
48+
# ----------------------------
49+
50+
if [ -z "$APPSTORE_CONNECT_P8" ]; then
51+
echo "ERROR: APPSTORE_CONNECT_P8 environment variable missing."
52+
exit 1
53+
fi
54+
55+
if [ -z "$APPSTORE_CONNECT_KEY_ID" ]; then
56+
echo "ERROR: APPSTORE_CONNECT_KEY_ID missing."
57+
exit 1
58+
fi
59+
60+
if [ -z "$APPSTORE_CONNECT_ISSUER_ID" ]; then
61+
echo "ERROR: APPSTORE_CONNECT_ISSUER_ID missing."
62+
exit 1
63+
fi
64+
65+
# Replace literal "\n" with real newlines
66+
P8_CONTENT=$(printf "%b" "$APPSTORE_CONNECT_P8")
67+
68+
KEY_DIR="$HOME/.appstoreconnect/private_keys"
69+
KEY_PATH="$KEY_DIR/AuthKey_${APPSTORE_CONNECT_KEY_ID}.p8"
70+
71+
mkdir -p "$KEY_DIR"
72+
73+
echo "Writing App Store Connect private key to:"
74+
echo "$KEY_PATH"
75+
76+
printf "%b" "$P8_CONTENT" > "$KEY_PATH"
77+
78+
79+
# ----------------------------
80+
# Upload using altool
81+
# ----------------------------
82+
83+
echo "Uploading IPA to TestFlight via altool…"
84+
85+
UPLOAD_CMD="xcrun altool --upload-app \
86+
-f \"$IPA_PATH\" \
87+
-t ios \
88+
--apiKey $APPSTORE_CONNECT_KEY_ID \
89+
--apiIssuer $APPSTORE_CONNECT_ISSUER_ID"
90+
91+
echo "Running: $UPLOAD_CMD"
92+
93+
if eval $UPLOAD_CMD; then
94+
echo "=== Upload IPA to Appstore Connect finished successfully ==="
95+
else
96+
echo "=== Upload IPA to Appstore Connect FAILED ==="
97+
exit 1
98+
fi
99+
100+
echo "=== TestFlight Upload Script Completed ==="

Assets/CloudBuild/testflight_upload.sh.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/SequenceSDK/Editor/TestflightUploadPostBuildScript.cs

Lines changed: 0 additions & 64 deletions
This file was deleted.

Assets/SequenceSDK/Editor/TestflightUploadPostBuildScript.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)