@@ -316,6 +316,42 @@ jobs:
316316 BROWSERSTACK_ACCESS_KEY : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
317317 working-directory : sample-unity6/Tests
318318 run : python -m pytest -xs test/test_windows.py::WindowsTest
319+ - name : Collect Unity Player logs (Windows)
320+ if : always()
321+ run : |
322+ $playerLogRoot = Join-Path $env:USERPROFILE "AppData\LocalLow\Immutable\Sample Unity 6 Windows"
323+ $workspaceLogs = "${{ github.workspace }}\sample-unity6\player-logs"
324+ $zipPath = "${{ github.workspace }}\sample-unity6\Unity6-Windows-PlayerLogs.zip"
325+
326+ New-Item -ItemType Directory -Force -Path $workspaceLogs | Out-Null
327+
328+ if (Test-Path $playerLogRoot) {
329+ Copy-Item -Force -Recurse "$playerLogRoot\*" $workspaceLogs -ErrorAction SilentlyContinue
330+ Write-Output "Copied player logs from: $playerLogRoot"
331+ } else {
332+ Write-Output "Player log directory not found: $playerLogRoot"
333+ }
334+
335+ # Also try to capture Unity crash dumps if present
336+ $unityCrashes = Join-Path $env:USERPROFILE "AppData\LocalLow\Unity\Crashes"
337+ if (Test-Path $unityCrashes) {
338+ $crashDst = Join-Path $workspaceLogs "UnityCrashes"
339+ New-Item -ItemType Directory -Force -Path $crashDst | Out-Null
340+ Copy-Item -Force -Recurse "$unityCrashes\*" $crashDst -ErrorAction SilentlyContinue
341+ Write-Output "Copied Unity crashes from: $unityCrashes"
342+ } else {
343+ Write-Output "Unity crashes directory not found: $unityCrashes"
344+ }
345+
346+ if (Test-Path $zipPath) { Remove-Item -Force $zipPath }
347+ Compress-Archive -Path "$workspaceLogs\*" -DestinationPath $zipPath -Force
348+ Write-Output "Player logs zip created: $zipPath"
349+ - name : Upload Unity Player logs (Windows)
350+ if : always()
351+ uses : actions/upload-artifact@v4
352+ with :
353+ name : Unity6-Windows-Player-Logs
354+ path : sample-unity6/Unity6-Windows-PlayerLogs.zip
319355 - name : Upload build log
320356 if : always()
321357 uses : actions/upload-artifact@v4
0 commit comments