Skip to content

Commit f335b94

Browse files
committed
Merge branch 'Feature/build-automation' into V5-EcosystemWallet
2 parents df95bd5 + b2d6c20 commit f335b94

File tree

190 files changed

+29256
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+29256
-92
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Unity Build Automation
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
test-and-build:
9+
runs-on: ubuntu-latest
10+
environment: github-pages
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
target:
16+
- mac-desktop
17+
- windows-desktop
18+
- ios
19+
- android
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
# ✅ Step 2 — Trigger Cloud Build for this target
25+
- name: Trigger Cloud Build
26+
id: trigger
27+
run: |
28+
branch_name="${{ github.head_ref || github.ref_name }}"
29+
30+
build_number=$(curl -s -X POST \
31+
-H "Authorization: Basic ${{ secrets.UNITY_API_KEY }}" \
32+
-H "Content-Type: application/json" \
33+
-d "{\"clean\": true, \"delay\": 0, \"commit\": null, \"headless\": true, \"branch\": \"$branch_name\"}" \
34+
https://build-api.cloud.unity3d.com/api/v1/orgs/6872789246035/projects/5fac262b-e52e-42f7-a9d6-d4464b2ff80e/buildtargets/${{ matrix.target }}/builds \
35+
| jq '.[0].build' )
36+
37+
echo "build_number=$build_number" >> $GITHUB_OUTPUT
38+
39+
# 📡 Step 3 — Poll Cloud Build result
40+
- name: Poll Build Status
41+
run: |
42+
for i in {1..60}; do
43+
status=$(curl -s \
44+
-H "Authorization: Basic ${{ secrets.UNITY_API_KEY }}" \
45+
https://build-api.cloud.unity3d.com/api/v1/orgs/6872789246035/projects/5fac262b-e52e-42f7-a9d6-d4464b2ff80e/buildtargets/${{ matrix.target }}/builds/${{ steps.trigger.outputs.build_number }} | jq -r '.buildStatus')
46+
47+
echo "Status: $status"
48+
49+
if [ "$status" = "success" ]; then exit 0; fi
50+
if [ "$status" = "failed" ]; then exit 1; fi
51+
52+
sleep 60
53+
done
54+
55+
echo "Build timed out"
56+
exit 1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Unity Build Automation Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
run-on-merge:
10+
runs-on: ubuntu-latest
11+
environment: github-pages
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
target:
17+
- ios-production
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- name: Trigger Cloud Build
23+
id: trigger
24+
run: |
25+
branch_name="${{ github.head_ref || github.ref_name }}"
26+
27+
build_number=$(curl -s -X POST \
28+
-H "Authorization: Basic ${{ secrets.UNITY_API_KEY }}" \
29+
-H "Content-Type: application/json" \
30+
-d "{\"clean\": true, \"delay\": 0, \"commit\": null, \"headless\": true, \"branch\": \"$branch_name\"}" \
31+
https://build-api.cloud.unity3d.com/api/v1/orgs/6872789246035/projects/5fac262b-e52e-42f7-a9d6-d4464b2ff80e/buildtargets/${{ matrix.target }}/builds \
32+
| jq '.[0].build' )

.github/workflows/unity-tests.yml

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

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
# Plugins
1414

15-
/[Aa]ssets/TextMesh Pro/
16-
/[Aa]ssets/TextMesh Pro.meta
15+
# /[Aa]ssets/TextMesh Pro/
16+
# /[Aa]ssets/TextMesh Pro.meta
1717
# MemoryCaptures can get excessive in size.
1818
# They also could contain extremely sensitive data
1919
/[Mm]emoryCaptures/
2020

2121
# Package Manager formatting
22-
/[Aa]ssets/TextMesh Pro
22+
# /[Aa]ssets/TextMesh Pro
2323
/[Aa]ssets/Resources
2424
/[Aa]ssets/Resources.meta
2525
/[Aa]ssets/Samples

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/Plugins/Android/mainTemplate.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ dependencies {
99
**DEPS**}
1010

1111
android {
12+
namespace "com.unity3d.player"
13+
ndkPath "**NDKPATH**"
1214
compileSdkVersion **APIVERSION**
1315
buildToolsVersion '**BUILDTOOLS**'
1416

Assets/Plugins/IngameDebugConsole.meta

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

Assets/Plugins/IngameDebugConsole/Android.meta

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

0 commit comments

Comments
 (0)