From 7def673c5ae8202202ff894134b9eaf5288c2e13 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 13:17:47 +0300 Subject: [PATCH 1/9] ci: replace game-ci Docker builder with direct Linux Unity install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoids pulling the 20GB unityci/editor Docker image on every cold runner. Instead downloads the Unity Linux editor once (~4.4GB), caches it at /opt/unity with actions/cache, and builds directly — same pattern as the iOS workflow. Uses the Android SDK already pre-installed on ubuntu-latest. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rc-e2e-android.yml | 75 ++++++++++++++++------------ 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index 597b7b9b..c200f5d7 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -37,43 +37,54 @@ jobs: run: | printf '%s' "${{ secrets.ENV_FILE }}" > test-app/Assets/StreamingAssets/.env - - name: Build Android APK (via Unity) - uses: game-ci/unity-builder@v4 - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + - name: Cache Unity Editor installation + id: cache-unity + uses: actions/cache@v4 with: - projectPath: test-app - unityVersion: 6000.3.5f1 - targetPlatform: Android - buildName: com.appsflyer.engagement - buildsPath: test-app/Build - buildMethod: BuildScript.BuildAndroid - androidExportType: androidPackage - allowDirtyBuild: true + path: /opt/unity + key: unity-6000.3.5f1-android-linux + + - name: Install Unity Editor (Linux) + if: steps.cache-unity.outputs.cache-hit != 'true' + run: | + curl -fL "https://download.unity3d.com/download_unity/a1ec4b2f2d19/LinuxEditorInstaller/Unity-6000.3.5f1.tar.xz" \ + -o /tmp/Unity-Linux.tar.xz + sudo mkdir -p /opt/unity + sudo tar -xf /tmp/Unity-Linux.tar.xz -C /opt/unity --strip-components=1 + echo "Unity installed at: /opt/unity/Editor/Unity" + timeout-minutes: 30 + + - name: Activate Unity license + run: | + /opt/unity/Editor/Unity -quit -batchmode \ + -serial "${{ secrets.UNITY_SERIAL }}" \ + -username "${{ secrets.UNITY_EMAIL }}" \ + -password "${{ secrets.UNITY_PASSWORD }}" \ + -logFile /tmp/unity-activate.log 2>&1 || true + grep -E "LICENSE|license|error|Error" /tmp/unity-activate.log || true + + - name: Build Android APK + run: | + mkdir -p test-app/Build/Android + /opt/unity/Editor/Unity -quit -batchmode \ + -logFile /tmp/unity-build.log \ + -projectPath "$(pwd)/test-app" \ + -buildTarget Android \ + -executeMethod BuildScript.BuildAndroid + BUILD_EXIT=$? + tail -50 /tmp/unity-build.log + exit $BUILD_EXIT + timeout-minutes: 30 - name: Return Unity license if: always() run: | - docker run --rm \ - --env UNITY_EMAIL \ - --env UNITY_PASSWORD \ - --env UNITY_SERIAL \ - --env HOME=/root \ - unityci/editor:ubuntu-6000.3.5f1-android-3 \ - bash -c " - unity-editor -quit -batchmode -returnlicense \ - -username \"\$UNITY_EMAIL\" \ - -password \"\$UNITY_PASSWORD\" \ - -logFile /tmp/unity-return.log 2>&1 || true - echo '=== unity-return.log ===' - cat /tmp/unity-return.log || true - " || true - env: - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + /opt/unity/Editor/Unity -quit -batchmode -returnlicense \ + -username "${{ secrets.UNITY_EMAIL }}" \ + -password "${{ secrets.UNITY_PASSWORD }}" \ + -logFile /tmp/unity-return.log 2>&1 || true + echo "=== unity-return.log ===" + cat /tmp/unity-return.log || true - name: Locate APK run: | From d7bb21a32f53700b6aae0c5c8da48f15b5bd315c Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 13:25:06 +0300 Subject: [PATCH 2/9] fix: find Unity binary dynamically after Linux tar extraction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Strip-components assumption was wrong — detect the actual path with find and fail fast with a directory listing if the binary isn't found. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rc-e2e-android.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index c200f5d7..4e0758ee 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -50,13 +50,25 @@ jobs: curl -fL "https://download.unity3d.com/download_unity/a1ec4b2f2d19/LinuxEditorInstaller/Unity-6000.3.5f1.tar.xz" \ -o /tmp/Unity-Linux.tar.xz sudo mkdir -p /opt/unity - sudo tar -xf /tmp/Unity-Linux.tar.xz -C /opt/unity --strip-components=1 - echo "Unity installed at: /opt/unity/Editor/Unity" + sudo tar -xf /tmp/Unity-Linux.tar.xz -C /opt/unity + UNITY=$(find /opt/unity -name "Unity" -type f 2>/dev/null | head -1) + echo "Unity installed at: $UNITY" + if [[ -z "$UNITY" ]]; then + echo "::error::Unity binary not found after extraction — listing /opt/unity:" + find /opt/unity -maxdepth 4 | head -30 + exit 1 + fi timeout-minutes: 30 + - name: Set Unity path + run: | + UNITY=$(find /opt/unity -name "Unity" -type f 2>/dev/null | head -1) + echo "UNITY_PATH=$UNITY" >> "$GITHUB_ENV" + echo "Unity path: $UNITY" + - name: Activate Unity license run: | - /opt/unity/Editor/Unity -quit -batchmode \ + "$UNITY_PATH" -quit -batchmode \ -serial "${{ secrets.UNITY_SERIAL }}" \ -username "${{ secrets.UNITY_EMAIL }}" \ -password "${{ secrets.UNITY_PASSWORD }}" \ @@ -66,7 +78,7 @@ jobs: - name: Build Android APK run: | mkdir -p test-app/Build/Android - /opt/unity/Editor/Unity -quit -batchmode \ + "$UNITY_PATH" -quit -batchmode \ -logFile /tmp/unity-build.log \ -projectPath "$(pwd)/test-app" \ -buildTarget Android \ @@ -79,7 +91,7 @@ jobs: - name: Return Unity license if: always() run: | - /opt/unity/Editor/Unity -quit -batchmode -returnlicense \ + "$UNITY_PATH" -quit -batchmode -returnlicense \ -username "${{ secrets.UNITY_EMAIL }}" \ -password "${{ secrets.UNITY_PASSWORD }}" \ -logFile /tmp/unity-return.log 2>&1 || true From 7e93c98b40c0e4236c0a13fba2614cc7b3b92944 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 13:49:08 +0300 Subject: [PATCH 3/9] fix: search for unity-editor binary (Linux name) not Unity On Linux Unity installs as unity-editor, not Unity (macOS name). Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rc-e2e-android.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index 4e0758ee..3377d72b 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -51,18 +51,18 @@ jobs: -o /tmp/Unity-Linux.tar.xz sudo mkdir -p /opt/unity sudo tar -xf /tmp/Unity-Linux.tar.xz -C /opt/unity - UNITY=$(find /opt/unity -name "Unity" -type f 2>/dev/null | head -1) + UNITY=$(find /opt/unity -type f \( -name "Unity" -o -name "unity-editor" \) 2>/dev/null | head -1) echo "Unity installed at: $UNITY" if [[ -z "$UNITY" ]]; then echo "::error::Unity binary not found after extraction — listing /opt/unity:" - find /opt/unity -maxdepth 4 | head -30 + find /opt/unity -maxdepth 4 | head -40 exit 1 fi timeout-minutes: 30 - name: Set Unity path run: | - UNITY=$(find /opt/unity -name "Unity" -type f 2>/dev/null | head -1) + UNITY=$(find /opt/unity -type f \( -name "Unity" -o -name "unity-editor" \) 2>/dev/null | head -1) echo "UNITY_PATH=$UNITY" >> "$GITHUB_ENV" echo "Unity path: $UNITY" From 2ad195bd6e656ec3f9c95b6bd6ff6bb84c2f40f1 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 13:51:39 +0300 Subject: [PATCH 4/9] ci: upload unity-build.log as artifact to diagnose Android build failure Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rc-e2e-android.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index 3377d72b..d81afd74 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -84,10 +84,19 @@ jobs: -buildTarget Android \ -executeMethod BuildScript.BuildAndroid BUILD_EXIT=$? - tail -50 /tmp/unity-build.log + echo "=== unity-build.log (last 80 lines) ===" + tail -80 /tmp/unity-build.log || echo "(log file missing)" exit $BUILD_EXIT timeout-minutes: 30 + - name: Upload Unity build log + if: always() + uses: actions/upload-artifact@v4 + with: + name: unity-build-log-${{ inputs.plugin_version }} + path: /tmp/unity-build.log + retention-days: 3 + - name: Return Unity license if: always() run: | From ccdbf9a8ecb8db44ec81e945d3631ed8b9690bf1 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 14:02:55 +0300 Subject: [PATCH 5/9] ci: add workflow to mirror Unity Android image to GHCR Pulls unityci/editor from Docker Hub and pushes to ghcr.io to avoid the 20GB cold-runner pull on every Android E2E run. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/push-unity-to-ghcr.yml | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/push-unity-to-ghcr.yml diff --git a/.github/workflows/push-unity-to-ghcr.yml b/.github/workflows/push-unity-to-ghcr.yml new file mode 100644 index 00000000..3e2b2b69 --- /dev/null +++ b/.github/workflows/push-unity-to-ghcr.yml @@ -0,0 +1,42 @@ +name: Push Unity Android image to GHCR + +on: + workflow_dispatch: + inputs: + unity_version: + description: Unity version tag (e.g. ubuntu-6000.3.5f1-android-3) + required: true + default: ubuntu-6000.3.5f1-android-3 + type: string + +jobs: + push-to-ghcr: + name: Pull from Docker Hub → Push to GHCR + runs-on: ubuntu-latest + timeout-minutes: 60 + + permissions: + contents: read + packages: write + + steps: + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull from Docker Hub + run: docker pull unityci/editor:${{ github.event.inputs.unity_version }} + + - name: Tag for GHCR + run: | + docker tag \ + unityci/editor:${{ github.event.inputs.unity_version }} \ + ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + + - name: Push to GHCR + run: | + docker push ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + echo "Image available at: ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }}" From 37361b956559227c3a18b4c618f097f962486c3a Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 14:06:57 +0300 Subject: [PATCH 6/9] ci: temporarily replace android e2e with GHCR push (one-time) Swap e2e-android-only.yml with the GHCR mirror workflow to push unityci/editor to ghcr.io. Will be reverted after the image is pushed. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/e2e-android-only.yml | 44 ++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e-android-only.yml b/.github/workflows/e2e-android-only.yml index 6afe4a8e..3e2b2b69 100644 --- a/.github/workflows/e2e-android-only.yml +++ b/.github/workflows/e2e-android-only.yml @@ -1,12 +1,42 @@ -name: E2E — Android only +name: Push Unity Android image to GHCR on: workflow_dispatch: + inputs: + unity_version: + description: Unity version tag (e.g. ubuntu-6000.3.5f1-android-3) + required: true + default: ubuntu-6000.3.5f1-android-3 + type: string jobs: - e2e-android: - uses: ./.github/workflows/rc-e2e-android.yml - with: - plugin_version: ${{ github.event.inputs.plugin_version || 'push-trigger' }} - release_branch: ${{ github.ref_name }} - secrets: inherit + push-to-ghcr: + name: Pull from Docker Hub → Push to GHCR + runs-on: ubuntu-latest + timeout-minutes: 60 + + permissions: + contents: read + packages: write + + steps: + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull from Docker Hub + run: docker pull unityci/editor:${{ github.event.inputs.unity_version }} + + - name: Tag for GHCR + run: | + docker tag \ + unityci/editor:${{ github.event.inputs.unity_version }} \ + ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + + - name: Push to GHCR + run: | + docker push ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + echo "Image available at: ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }}" From c50b8f103c0487b520ded7f009ee4ecdbda6c143 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 14:14:44 +0300 Subject: [PATCH 7/9] fix: lowercase GHCR owner in docker tag/push commands Docker requires lowercase repository names; github.repository_owner returns 'AppsFlyerSDK' which breaks the tag step. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/e2e-android-only.yml | 8 +++++--- .github/workflows/push-unity-to-ghcr.yml | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-android-only.yml b/.github/workflows/e2e-android-only.yml index 3e2b2b69..c9970880 100644 --- a/.github/workflows/e2e-android-only.yml +++ b/.github/workflows/e2e-android-only.yml @@ -32,11 +32,13 @@ jobs: - name: Tag for GHCR run: | + OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') docker tag \ unityci/editor:${{ github.event.inputs.unity_version }} \ - ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} - name: Push to GHCR run: | - docker push ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} - echo "Image available at: ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }}" + OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + docker push ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} + echo "Image available at: ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }}" diff --git a/.github/workflows/push-unity-to-ghcr.yml b/.github/workflows/push-unity-to-ghcr.yml index 3e2b2b69..c9970880 100644 --- a/.github/workflows/push-unity-to-ghcr.yml +++ b/.github/workflows/push-unity-to-ghcr.yml @@ -32,11 +32,13 @@ jobs: - name: Tag for GHCR run: | + OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') docker tag \ unityci/editor:${{ github.event.inputs.unity_version }} \ - ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} + ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} - name: Push to GHCR run: | - docker push ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }} - echo "Image available at: ghcr.io/${{ github.repository_owner }}/unity-android:${{ github.event.inputs.unity_version }}" + OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') + docker push ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} + echo "Image available at: ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }}" From 1dff0564628eac14ab0ab3280389522193207629 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 14:16:10 +0300 Subject: [PATCH 8/9] fix: use direct docker login instead of login-action for GHCR The docker/login-action was timing out connecting to ghcr.io. Switching to direct docker login command. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/e2e-android-only.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/e2e-android-only.yml b/.github/workflows/e2e-android-only.yml index c9970880..b909882f 100644 --- a/.github/workflows/e2e-android-only.yml +++ b/.github/workflows/e2e-android-only.yml @@ -21,11 +21,7 @@ jobs: steps: - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - name: Pull from Docker Hub run: docker pull unityci/editor:${{ github.event.inputs.unity_version }} From 4aca2a5c3ed156441f436cd2d7839869e088d694 Mon Sep 17 00:00:00 2001 From: "kobi.kagan" Date: Tue, 19 May 2026 14:49:43 +0300 Subject: [PATCH 9/9] ci: use GHCR image for Android E2E via game-ci customImage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restore e2e-android-only.yml to its original delegate form - Rewrite rc-e2e-android.yml to pull from GHCR instead of Docker Hub using game-ci/unity-builder@v4 customImage — saves ~70 min per run Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/e2e-android-only.yml | 42 +++----------- .github/workflows/rc-e2e-android.yml | 76 ++++++-------------------- 2 files changed, 23 insertions(+), 95 deletions(-) diff --git a/.github/workflows/e2e-android-only.yml b/.github/workflows/e2e-android-only.yml index b909882f..6afe4a8e 100644 --- a/.github/workflows/e2e-android-only.yml +++ b/.github/workflows/e2e-android-only.yml @@ -1,40 +1,12 @@ -name: Push Unity Android image to GHCR +name: E2E — Android only on: workflow_dispatch: - inputs: - unity_version: - description: Unity version tag (e.g. ubuntu-6000.3.5f1-android-3) - required: true - default: ubuntu-6000.3.5f1-android-3 - type: string jobs: - push-to-ghcr: - name: Pull from Docker Hub → Push to GHCR - runs-on: ubuntu-latest - timeout-minutes: 60 - - permissions: - contents: read - packages: write - - steps: - - name: Log in to GHCR - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - - name: Pull from Docker Hub - run: docker pull unityci/editor:${{ github.event.inputs.unity_version }} - - - name: Tag for GHCR - run: | - OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - docker tag \ - unityci/editor:${{ github.event.inputs.unity_version }} \ - ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} - - - name: Push to GHCR - run: | - OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') - docker push ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }} - echo "Image available at: ghcr.io/${OWNER}/unity-android:${{ github.event.inputs.unity_version }}" + e2e-android: + uses: ./.github/workflows/rc-e2e-android.yml + with: + plugin_version: ${{ github.event.inputs.plugin_version || 'push-trigger' }} + release_branch: ${{ github.ref_name }} + secrets: inherit diff --git a/.github/workflows/rc-e2e-android.yml b/.github/workflows/rc-e2e-android.yml index d81afd74..19cf8f26 100644 --- a/.github/workflows/rc-e2e-android.yml +++ b/.github/workflows/rc-e2e-android.yml @@ -37,56 +37,22 @@ jobs: run: | printf '%s' "${{ secrets.ENV_FILE }}" > test-app/Assets/StreamingAssets/.env - - name: Cache Unity Editor installation - id: cache-unity - uses: actions/cache@v4 - with: - path: /opt/unity - key: unity-6000.3.5f1-android-linux - - - name: Install Unity Editor (Linux) - if: steps.cache-unity.outputs.cache-hit != 'true' - run: | - curl -fL "https://download.unity3d.com/download_unity/a1ec4b2f2d19/LinuxEditorInstaller/Unity-6000.3.5f1.tar.xz" \ - -o /tmp/Unity-Linux.tar.xz - sudo mkdir -p /opt/unity - sudo tar -xf /tmp/Unity-Linux.tar.xz -C /opt/unity - UNITY=$(find /opt/unity -type f \( -name "Unity" -o -name "unity-editor" \) 2>/dev/null | head -1) - echo "Unity installed at: $UNITY" - if [[ -z "$UNITY" ]]; then - echo "::error::Unity binary not found after extraction — listing /opt/unity:" - find /opt/unity -maxdepth 4 | head -40 - exit 1 - fi - timeout-minutes: 30 - - - name: Set Unity path - run: | - UNITY=$(find /opt/unity -type f \( -name "Unity" -o -name "unity-editor" \) 2>/dev/null | head -1) - echo "UNITY_PATH=$UNITY" >> "$GITHUB_ENV" - echo "Unity path: $UNITY" - - - name: Activate Unity license - run: | - "$UNITY_PATH" -quit -batchmode \ - -serial "${{ secrets.UNITY_SERIAL }}" \ - -username "${{ secrets.UNITY_EMAIL }}" \ - -password "${{ secrets.UNITY_PASSWORD }}" \ - -logFile /tmp/unity-activate.log 2>&1 || true - grep -E "LICENSE|license|error|Error" /tmp/unity-activate.log || true + - name: Log in to GHCR + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - name: Build Android APK - run: | - mkdir -p test-app/Build/Android - "$UNITY_PATH" -quit -batchmode \ - -logFile /tmp/unity-build.log \ - -projectPath "$(pwd)/test-app" \ - -buildTarget Android \ - -executeMethod BuildScript.BuildAndroid - BUILD_EXIT=$? - echo "=== unity-build.log (last 80 lines) ===" - tail -80 /tmp/unity-build.log || echo "(log file missing)" - exit $BUILD_EXIT + uses: game-ci/unity-builder@v4 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + with: + unityVersion: 6000.3.5f1 + targetPlatform: Android + customImage: ghcr.io/appsflyersdk/unity-android:ubuntu-6000.3.5f1-android-3 + projectPath: test-app + buildMethod: BuildScript.BuildAndroid + buildsPath: test-app/Build timeout-minutes: 30 - name: Upload Unity build log @@ -97,19 +63,9 @@ jobs: path: /tmp/unity-build.log retention-days: 3 - - name: Return Unity license - if: always() - run: | - "$UNITY_PATH" -quit -batchmode -returnlicense \ - -username "${{ secrets.UNITY_EMAIL }}" \ - -password "${{ secrets.UNITY_PASSWORD }}" \ - -logFile /tmp/unity-return.log 2>&1 || true - echo "=== unity-return.log ===" - cat /tmp/unity-return.log || true - - name: Locate APK run: | - APK=$(find test-app/Build/Android -name "*.apk" | head -1) + APK=$(find test-app/Build -name "*.apk" | head -1) if [[ -z "$APK" ]]; then echo "::error::APK not found after Unity build" exit 1 @@ -136,7 +92,7 @@ jobs: disable-animations: true script: | adb wait-for-device - adb install -r "${{ env.APK_PATH }}" + adb install -r "$APK_PATH" adb shell am force-stop com.appsflyer.engagement chmod +x scripts/af-scenario-runner.sh scripts/af-scenario-runner.sh --platform android --plan .af-e2e/test-plan.json --verbose