@@ -251,7 +251,7 @@ jobs:
251251 UNITY_LICENSE : ${{ secrets.UNITY_LICENSE }}
252252 UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
253253 UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
254- SC_BUILD_OUTPUT : dist/SpaceCraft
254+ SC_BUILD_OUTPUT : ${{ github.workspace }}/ dist/SpaceCraft
255255 with :
256256 projectPath : ${{ steps.detect.outputs.projectPath }}
257257 targetPlatform : ${{ inputs.targetPlatform }}
@@ -304,8 +304,25 @@ jobs:
304304 run : |
305305 set -euo pipefail
306306 STAGE="dist"
307- echo "[assemble] Using Unity output already at $STAGE/SpaceCraft"
307+ echo "[assemble] Expecting Unity output at $STAGE/SpaceCraft"
308+ test -d "$STAGE/SpaceCraft" || { echo "[assemble] ERROR: Unity output missing at $STAGE/SpaceCraft" >&2; exit 1; }
308309 mkdir -p "$STAGE/controller"
310+ # If Unity output missing, try common fallback paths
311+ if [[ ! -d "$STAGE/SpaceCraft" ]]; then
312+ CAND1="${{ steps.detect.outputs.projectPath }}/Builds/SpaceCraft"
313+ CAND2="WebSites/SpaceCraft"
314+ if [[ -d "$CAND1" ]]; then
315+ echo "[assemble] Fallback: copying from $CAND1"
316+ mkdir -p "$STAGE/SpaceCraft"
317+ rsync -a "$CAND1/" "$STAGE/SpaceCraft/"
318+ elif [[ -d "$CAND2" ]]; then
319+ echo "[assemble] Fallback: copying from $CAND2"
320+ mkdir -p "$STAGE/SpaceCraft"
321+ rsync -a "$CAND2/" "$STAGE/SpaceCraft/"
322+ else
323+ echo "[assemble] WARNING: Unity output not found in dist/SpaceCraft, $CAND1, or $CAND2"
324+ fi
325+ fi
309326 # Top-level site index
310327 if [[ -f WebSites/index.html ]]; then
311328 cp -f WebSites/index.html "$STAGE/index.html"
@@ -336,5 +353,5 @@ jobs:
336353 if : success()
337354 uses : actions/upload-artifact@v4
338355 with :
339- name : site.zip
356+ name : site
340357 path : site.zip
0 commit comments