Skip to content

Commit b9335f5

Browse files
ci(audience): detect Linux Unity activation via log, not file path (SDK-255)
- Replaces the file-existence check at ~/.local/share/unity3d/Unity/Unity_lic.ulf with a grep on Unity's activation log for "Successfully activated the entitlement license" or "Successfully processed license management request". - Modern Unity Licensing Client (2021.3+) stores state in a path that varies by install and Unity version, so the file check returned false even after a successful activation. The first CI attempt failed for this reason while Unity itself reported activation succeeded. - Activation now always runs. Re-running on the same machine reuses the existing seat by machine fingerprint, so the seat cost stays at one per runner. The skip-if-cached path is removed because the previous "cached" detection was unreliable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3dcc092 commit b9335f5

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

.github/workflows/test-audience-sample-app.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -365,32 +365,22 @@ jobs:
365365
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
366366
run: |
367367
set -uo pipefail
368-
# Activate-once-and-cache. Unity Pro/Plus seats are scarce; the license
369-
# file persists in $HOME on the self-hosted runner so subsequent runs
370-
# detect it and skip activation. Win/macOS runners are pre-activated
371-
# manually outside the workflow; Linux activates here because the host
372-
# was provisioned fresh.
373-
LICENSE_FILE="$HOME/.local/share/unity3d/Unity/Unity_lic.ulf"
374-
if [ -f "$LICENSE_FILE" ]; then
375-
echo "Unity license already cached at $LICENSE_FILE; skipping activation"
376-
exit 0
377-
fi
378-
368+
LOG="$(mktemp)"
379369
echo "::group::Activate Unity"
380-
# Unity exits non-zero on -quit even when activation succeeds, so the
381-
# license-file existence check below is the real success gate.
382370
"$UNITY_PATH" -batchmode -nographics -quit \
383371
-username "$UNITY_EMAIL" \
384372
-password "$UNITY_PASSWORD" \
385373
-serial "$UNITY_SERIAL" \
386-
-logFile - 2>&1 || true
374+
-logFile - 2>&1 | tee "$LOG" || true
387375
echo "::endgroup::"
388376
389-
if [ ! -f "$LICENSE_FILE" ]; then
390-
echo "::error::Unity activation failed: no license file at $LICENSE_FILE. Check UNITY_EMAIL/UNITY_PASSWORD/UNITY_SERIAL secrets and seat-pool availability."
391-
exit 1
377+
if grep -qE "(Successfully activated the entitlement license|Successfully processed license management request)" "$LOG"; then
378+
echo "Unity license is active"
379+
exit 0
392380
fi
393-
echo "Activated; license file at $LICENSE_FILE"
381+
382+
echo "::error::Unity activation failed. Check UNITY_EMAIL/UNITY_PASSWORD/UNITY_SERIAL secrets and seat-pool availability."
383+
exit 1
394384
395385
- name: Run PlayMode tests (macOS)
396386
if: runner.os == 'macOS'

0 commit comments

Comments
 (0)