mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-09-29 12:07:05 -07:00
feat: rework thin wrapper to invoke game-ci/cli as a subprocess
Supersedes the previous approach on this branch, which imported @game-ci/unity-engine-core as an in-process library. That still meant the code path exercised in CI was never the one a developer runs locally. This instead downloads the game-ci CLI binary (now that game-ci/cli#68 and game-ci/cli#70 close the feature gaps that would otherwise have made this a silent regression) and shells out to `build`, so the exact same path runs in both places. - build-args.ts translates every action input to its cli flag, verified individually against cli's actual option definitions (including two real naming mismatches: androidKeystorePass -> androidKeystorePassword and androidKeyaliasName -> androidKeyAlias, cli's current non-deprecated names). - download-cli.ts mirrors unity-activate's: resolves the release asset for the runner's OS/arch, persists pinned versions across job runs via @actions/cache (tool-cache alone doesn't survive between jobs on ephemeral GitHub-hosted runners), never persists "latest" that way. - Credentials (UNITY_EMAIL etc.) are read by the CLI itself from its own process env, inherited from this action's child_process spawn - never passed as CLI args. - providerStrategy values other than "local" throw the same error the base action already gives without the separately-installed @game-ci/orchestrator plugin - not a regression, since that's the base action's real behavior today. - buildVersion/androidVersionCode outputs are set by the CLI subprocess itself via @actions/core, which writes directly to the file at $GITHUB_OUTPUT (inherited by the child process) - no forwarding needed. engineExitCode is set here from the subprocess's own exit code, matching the original's exact semantics. `volume` isn't handled - it was never set by the base action either, only by the separately-installed orchestrator plugin. - action.yml gains a `cliVersion` input (default "latest"). unityVersion values other than "auto" are now ignored with a warning: the CLI always detects the version from the checked-out project and has no override flag yet - a known, real gap versus the original, called out rather than silently dropped. - Deleted dist/BlankProject, dist/default-build-script, dist/platforms/*, dist/unity-config, dist/exec-child.js: all dead under the new structure. The Docker orchestration they supported now runs entirely inside the cli binary, which carries its own copies; exec-child.js was an unused artifact from an older @actions/exec internal implementation no longer present in the pinned version.
This commit is contained in:
+4
-1
@@ -32,7 +32,10 @@
|
||||
"node": ">=18.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"@game-ci/unity-engine-core": "game-ci/unity-engine-core#main"
|
||||
"@actions/cache": "^3.2.4",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/tool-cache": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^17.0.23",
|
||||
|
||||
Reference in New Issue
Block a user