Skip to content

Commit 4e5ffc0

Browse files
committed
refactor: simplify Unity CI setup by removing game-ci activation and using built-in license handling
1 parent e9520ee commit 4e5ffc0

File tree

1 file changed

+24
-57
lines changed

1 file changed

+24
-57
lines changed

.github/workflows/claude-nl-suite.yml

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -67,82 +67,49 @@ jobs:
6767
echo "No MCP Python deps found (skipping)"
6868
fi
6969
70-
# --- Use game-ci for Unity activation (handles all license types) ---
71-
- name: Activate Unity using game-ci
72-
uses: game-ci/unity-activator@v2
73-
env:
74-
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
75-
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
76-
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
77-
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
70+
# Cache Unity Library to speed up runs
71+
- uses: actions/cache@v4
7872
with:
79-
unity-version: 2021.3.45f2
80-
81-
# Copy activation artifacts to Docker mount locations
82-
- name: Prepare Unity license for Docker containers
83-
shell: bash
84-
run: |
85-
set -euxo pipefail
86-
mkdir -p "$RUNNER_TEMP/unity-config" "$RUNNER_TEMP/unity-local"
87-
88-
# game-ci stores license files in standard Unity locations
89-
# Copy them to our Docker mount points
90-
if [ -d "$HOME/.local/share/unity3d" ]; then
91-
cp -r "$HOME/.local/share/unity3d"/* "$RUNNER_TEMP/unity-local/" || true
92-
fi
93-
if [ -d "$HOME/.config/unity3d" ]; then
94-
cp -r "$HOME/.config/unity3d"/* "$RUNNER_TEMP/unity-config/" || true
95-
fi
96-
97-
# Verify license files exist
98-
echo "Unity license files prepared:"
99-
find "$RUNNER_TEMP/unity-local" -type f || true
100-
find "$RUNNER_TEMP/unity-config" -type f || true
101-
102-
# ---------- Warm up project (import Library once) ----------
103-
- name: Warm up project (import Library once)
104-
if: steps.detect.outputs.unity_ok == 'true'
105-
shell: bash
106-
env:
107-
UNITY_IMAGE: ${{ env.UNITY_IMAGE }}
108-
run: |
109-
set -euxo pipefail
110-
docker run --rm --network host \
111-
-e HOME=/root \
112-
-v "${{ github.workspace }}:/workspace" -w /workspace \
113-
-v "$RUNNER_TEMP/unity-config:/root/.config/unity3d" \
114-
-v "$RUNNER_TEMP/unity-local:/root/.local/share/unity3d" \
115-
"$UNITY_IMAGE" /opt/unity/Editor/Unity -batchmode -nographics -logFile - \
116-
-projectPath /workspace/TestProjects/UnityMCPTests \
117-
-quit
73+
path: TestProjects/UnityMCPTests/Library
74+
key: Library-UnityMCPTests-2021.3.45f2-${{ hashFiles('TestProjects/UnityMCPTests/Assets/**', 'TestProjects/UnityMCPTests/Packages/**', 'TestProjects/UnityMCPTests/ProjectSettings/**') }}
75+
restore-keys: |
76+
Library-UnityMCPTests-2021.3.45f2-
77+
Library-UnityMCPTests-
11878
11979
# ---------- Clean old MCP status ----------
12080
- name: Clean old MCP status
12181
run: |
12282
set -eux
123-
mkdir -p "$HOME/.unity-mcp"
124-
rm -f "$HOME/.unity-mcp"/unity-mcp-status-*.json || true
83+
mkdir -p "$RUNNER_TEMP/unity-status"
84+
rm -f "$RUNNER_TEMP/unity-status"/unity-mcp-status-*.json || true
12585
126-
# ---------- Start headless Unity (persistent bridge) ----------
127-
- name: Start Unity (persistent bridge)
86+
# ---------- Start headless Unity with MCP bridge ----------
87+
- name: Start Unity MCP bridge in background
12888
if: steps.detect.outputs.unity_ok == 'true'
12989
shell: bash
13090
env:
131-
UNITY_IMAGE: ${{ env.UNITY_IMAGE }}
91+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
92+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
93+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
94+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
13295
run: |
13396
set -euxo pipefail
134-
mkdir -p "$RUNNER_TEMP/unity-status"
97+
98+
# The unityci/editor image supports licensing via env vars
99+
# Pass credentials and let Unity activate itself on first run
135100
docker rm -f unity-mcp >/dev/null 2>&1 || true
136101
docker run -d --name unity-mcp --network host \
137-
-e HOME=/root \
102+
-e UNITY_EMAIL \
103+
-e UNITY_PASSWORD \
104+
-e UNITY_LICENSE \
105+
-e UNITY_SERIAL \
138106
-e UNITY_MCP_ALLOW_BATCH=1 \
139107
-e UNITY_MCP_STATUS_DIR=/root/.unity-mcp \
140108
-e UNITY_MCP_BIND_HOST=127.0.0.1 \
141109
-v "${{ github.workspace }}:/workspace" -w /workspace \
142110
-v "$RUNNER_TEMP/unity-status:/root/.unity-mcp" \
143-
-v "$RUNNER_TEMP/unity-config:/root/.config/unity3d" \
144-
-v "$RUNNER_TEMP/unity-local:/root/.local/share/unity3d" \
145-
"$UNITY_IMAGE" /opt/unity/Editor/Unity -batchmode -nographics -logFile - \
111+
${{ env.UNITY_IMAGE }} \
112+
/opt/unity/Editor/Unity -batchmode -nographics -logFile - \
146113
-stackTraceLogType Full \
147114
-projectPath /workspace/TestProjects/UnityMCPTests \
148115
-executeMethod MCPForUnity.Editor.MCPForUnityBridge.StartAutoConnect

0 commit comments

Comments
 (0)