Automate publishing Android editor to Meta Horizon store (#138)

This commit is contained in:
David Snopek
2025-12-12 08:02:26 -06:00
committed by GitHub
parent 8a943c3f00
commit 7dca209db6
3 changed files with 66 additions and 1 deletions

55
build-android/upload-horizon.sh Executable file
View File

@@ -0,0 +1,55 @@
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <version-name> <latest-stable>"
exit 1
fi
VERSION_NAME="$1"
LATEST_STABLE="$2"
BASEDIR="$(pwd)"
source ${BASEDIR}/config.sh
TMPDIR=$(mktemp -d)
cleanup() {
rm -rf "$TMPDIR"
}
trap cleanup EXIT
OVR_PLATFORM_UTIL_DOWNLOAD_URL="https://www.oculus.com/download_app/?id=5159709737372459"
OVR_PLATFORM_UTIL="$TMPDIR/ovr-platform-util"
APK_FILE="${BASEDIR}/out/android/tools/android_editor_horizonos.apk"
NDS_FILE="${BASEDIR}/out/android/tools/android_editor_native_debug_symbols.zip"
NDS_OUTPUT_DIR="$TMPDIR/nds"
STATUS=$(echo "$VERSION_NAME" | sed -e 's/^.*-\([a-z][a-z]*\)[0-9]*$/\1/')
if [ "$STATUS" = "stable" -a "$LATEST_STABLE" = "1" ]; then
HORIZON_STORE_CHANNEL="LIVE"
elif [ "$STATUS" = "dev" ]; then
HORIZON_STORE_CHANNEL="ALPHA"
elif [ "$STATUS" = "beta" ]; then
HORIZON_STORE_CHANNEL="BETA"
elif [ "$STATUS" = "rc" ]; then
HORIZON_STORE_CHANNEL="RC"
else
echo "Unable to determine Horizon store channel from version status: $STATUS" >/dev/stderr
exit 1
fi
mkdir -p "$NDS_OUTPUT_DIR"
(cd "$NDS_OUTPUT_DIR" && unzip "$NDS_FILE")
echo "Downloading ovr-platform-util..."
if ! curl -fL -o "$OVR_PLATFORM_UTIL" "$OVR_PLATFORM_UTIL_DOWNLOAD_URL"; then
exit 1
fi
chmod +x "$OVR_PLATFORM_UTIL"
echo "Uploading $VERSION_NAME to Horizon store on channel $HORIZON_STORE_CHANNEL..."
if ! $OVR_PLATFORM_UTIL upload-quest-build --app-id "$GODOT_ANDROID_HORIZON_APP_ID" --app-secret "$GODOT_ANDROID_HORIZON_APP_SECRET" --apk "$APK_FILE" --channel "$HORIZON_STORE_CHANNEL" --debug-symbols-dir "$NDS_OUTPUT_DIR/arm64-v8a/" --debug-symbols-pattern '*.so'; then
exit 1
fi

View File

@@ -101,3 +101,6 @@ export GODOT_ANDROID_SIGN_PASSWORD=''
# Google Cloud Service Account JSON key with access to Play Console upload permissions
# (View app information + Release apps to production and/or testing.)
export GODOT_ANDROID_UPLOAD_JSON_KEY=''
# Horizon Store app ID and secret.
export GODOT_ANDROID_HORIZON_APP_ID=''
export GODOT_ANDROID_HORIZON_APP_SECRET=''

View File

@@ -187,7 +187,14 @@ if [ -e "${GODOT_ANDROID_UPLOAD_JSON_KEY}" ]; then
echo "Publishing Android Editor to Play Store..."
sh build-android/upload-playstore.sh ${godot_version}
else
echo "Disabling Android Editor publishing as no valid Play Store JSON key was found."
echo "Disabling Android Editor publishing on the Play Store as no valid Play Store JSON key was found."
fi
if [ ! -z "${GODOT_ANDROID_HORIZON_APP_ID}" ] && [ ! -z "${GODOT_ANDROID_HORIZON_APP_SECRET}" ]; then
echo "Publishing Android Editor to Horizon Store..."
./build-android/upload-horizon.sh ${godot_version} ${latest_stable}
else
echo "Disabling Android Editor publishing on the Horizon Store as config.sh does not define the required data (GODOT_ANDROID_HORIZON_APP_ID, GODOT_ANDROID_HORIZON_SECRET)."
fi
# Godot Android library