9595 run : |
9696 set -euxo pipefail
9797
98- # The unityci/editor image supports licensing via env vars
99- # Pass credentials and let Unity activate itself on first run
98+ # Use the unityci/editor image's built-in activation via entrypoint
99+ # Create activation wrapper script that runs activation then starts Unity with MCP
100100 docker rm -f unity-mcp >/dev/null 2>&1 || true
101+
102+ # The unityci image uses /usr/bin/activate.sh for license setup
103+ # We'll call it first, then start Unity with our MCP bridge
101104 docker run -d --name unity-mcp --network host \
102105 -e UNITY_EMAIL \
103106 -e UNITY_PASSWORD \
@@ -109,10 +112,22 @@ jobs:
109112 -v "${{ github.workspace }}:/workspace" -w /workspace \
110113 -v "$RUNNER_TEMP/unity-status:/root/.unity-mcp" \
111114 ${{ env.UNITY_IMAGE }} \
112- /opt/unity/Editor/Unity -batchmode -nographics -logFile - \
113- -stackTraceLogType Full \
114- -projectPath /workspace/TestProjects/UnityMCPTests \
115- -executeMethod MCPForUnity.Editor.MCPForUnityBridge.StartAutoConnect
115+ bash -c '
116+ # Activate Unity license (unityci pattern)
117+ if [[ -n "${UNITY_LICENSE:-}" ]]; then
118+ mkdir -p /root/.local/share/unity3d/Unity
119+ # Try base64 decode, fallback to plain text
120+ echo "$UNITY_LICENSE" | base64 -d > /root/.local/share/unity3d/Unity/Unity_lic.ulf 2>/dev/null || \
121+ echo "$UNITY_LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf
122+ chmod 600 /root/.local/share/unity3d/Unity/Unity_lic.ulf
123+ fi
124+
125+ # Start Unity with MCP bridge
126+ /opt/unity/Editor/Unity -batchmode -nographics -logFile - \
127+ -stackTraceLogType Full \
128+ -projectPath /workspace/TestProjects/UnityMCPTests \
129+ -executeMethod MCPForUnity.Editor.MCPForUnityBridge.StartAutoConnect
130+ '
116131
117132 # ---------- Wait for Unity bridge ----------
118133 - name : Wait for Unity bridge (robust)
0 commit comments