Skip to content

unity-cli@v4.0.0 - #86

Open
StephenHodgson wants to merge 52 commits into
mainfrom
dev/v4.0.0
Open

StephenHodgson wants to merge 52 commits into
mainfrom
dev/v4.0.0

Conversation

@StephenHodgson

@StephenHodgson StephenHodgson commented Oct 24, 2026 •

Copy link
Copy Markdown
Member
  • wrap Unity's official CLI (unity) and keep only the gaps it lacks
  • commands install the official CLI on first use: latest from Unity's CDN, SHA-256 checked against Unity's release manifest, cached in the runner tool cache, exports UNITY_CLI_PATH/UNITY_CLI_VERSION so later steps reuse it; --unity-cli-version on any command or UNITY_CLI_VERSION picks a release
  • setup-unity: 2017.4+ installs with unity install/unity install-modules, 5.x from Unity's download archive (the CLI misreads 5.x as 5000.x), 4.x with v3's installer; exports UNITY_CLI_PATH instead of UNITY_HUB_PATH
  • with only --unity-project, setup-unity installs modules for the project's saved build profiles; --modules/--build-targets override (closes Install modules based on BuildProfiles in project #68)
  • installer downloads are checksum-pinned or verified against the Releases API, and fail closed when no checksum is known
  • licensing: a cached license file (--license-file/UNITY_LICENSE) first, then unity license, then v3's licensing client with email/password; credentials can come from UNITY_USERNAME/UNITY_PASSWORD/UNITY_SERIAL
  • licensing client comes from the copy the official CLI manages; 4.x/5.x editors use a patched copy in a private per-user folder, and macOS 4.x/5.x uses the client bundled with Hub 3.12.0
  • new license-file-path command
  • return-license --when auto (default) skips returning a personal or professional license on GitHub-hosted macOS and Linux runners, which share one machine identity across jobs and repos; always/never override
  • a cached license file bound to a different machine identity is skipped in favor of the account
  • failures a rerun can clear are annotated unity-license-exhausted (no free seat) or unity-transient-failure (network/CDN 5xx)
  • run launches through unity run for 2019.1+ projects, falls back to a direct launch when unity run rejects an argument, and keeps direct launch for no-project, Android builds, older editors, Linux xvfb and Rosetta
  • run no longer sets UNITY_THISISABUILDMACHINE, which pointed Android Gradle builds at Unity's internal repositories
  • after a failed run, the Editor log's error lines (no stack frames, up to 100) print outside the log group; annotations unchanged
  • processes the tool starts are cleaned up and settle on exit, with timeouts on the licensing client
  • credentials, license tokens and sensitive editor arguments are masked in logs, errors and Editor log output
  • removed: Hub commands, install-all-tools, hub-install, package-manager-logs, sign-package; no pass-through of unknown commands to unity
  • Linux editor dependencies install with apt timeouts and retries, streamed to the log; ffmpeg is opt-in with UNITY_CLI_LINUX_FFMPEG=true
  • uninstall-unity, list-project-templates, create-project and open-project keep their v3 options, warn that they are deprecated, and forward to unity uninstall, unity templates list, unity projects create and unity open; create-project --template takes a template id or id prefix instead of a regex
  • upm-install, upm-version and upm-pack unchanged from v3
  • README: maintenance notice without an archive date, v3 to v4 command map
  • unity-build.yml: steps remapped to v4 commands and unity; checks upm-install/upm-version; 60 minute job cap; matrix values passed through env
  • CI licensing: macOS and Linux rows activate from the UNITY_LICENSE_MACOS/UNITY_LICENSE_LINUX secrets and refresh them with CI_TOKEN when they expire (never on pull requests); only Windows rows return the license
  • matrix adds 6000.6, the 6000.7 beta and the 7000.0 alpha; each row runs the newest build of its stream (--channel f,b,a)
  • PRs and pushes test 6000.0 through 7000.0; 4.7.2 through 2022.3 run monthly or from a manual run with editors: legacy (build-options-legacy.json)
  • removed the preview canary workflow, now covered by the matrix; weekly release discovery also tracks beta and alpha streams and writes its report to the run summary instead of an issue, with no issue permissions
  • workflow actions bumped: checkout v7, setup-node v7, free-disk-space v4.0.1, actions-timeline v3.2.1; timeouts on every job; npm ci and pinned npm in publish; openupm-cli@4.5.2 pinned
  • dropped @electron/asar and tar; yaml moved to dev deps; commander 15, jest 30.5, ts-jest 29.4.15; brace-expansion override
  • version 4.0.0

@StephenHodgson StephenHodgson self-assigned this Oct 24, 2026
Comment thread src/license-client.ts Fixed
Comment thread src/unity-cli.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/github-actions-ci.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
Comment thread src/unity-installer.ts Fixed
@StephenHodgson
StephenHodgson marked this pull request as ready for review October 25, 2026 03:35
Copilot AI balanced review requested due to automatic review settings October 25, 2026 03:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Serial disclosure and unresolved licensing, editor selection, module installation, and launch regressions block approval.

6 open issues
What changed in this PR

Migrates unity-cli v4 from Unity Hub management to a companion for Unity’s official CLI, retaining legacy editor support, licensing fallbacks, Android SDK setup, and annotated Editor logs.

Changes:

  • Adds official CLI installation, caching, editor installation, and launch integration.
  • Reworks licensing and removes overlapping Hub, project, and package commands.
  • Updates migration documentation, tests, dependencies, and CI workflows.
File Description
tests/​upm-cli.test.ts Removes tests for the retired UPM wrapper.
tests/​unity-installer-release-api-filter.test.ts Moves release-filter tests to UnityInstaller.
tests/​unity-hub.test.ts Removes Hub integration tests.
tests/​unity-editor.test.ts Uses local fixtures and tests launch arguments.
tests/​unity-cli.test.ts Adds CLI helpers, licensing fallback, and redaction tests.
tests/​mocks/​electron-asar.js Removes the obsolete ASAR mock.
tests/​linux-hub-path.test.ts Removes Hub path tests.
tests/​hub-cdn-urls.test.ts Removes Hub CDN checks.
src/​upm-cli.ts Removes the UPM wrapper.
src/​unity-installer.ts Adds official CLI and legacy archive installation paths.
src/​unity-hub.ts Removes Hub management.
src/​unity-editor.ts Integrates official CLI launches with direct-launch fallbacks.
src/​unity-cli.ts Adds CLI discovery, downloads, caching, and command execution.
src/​logging.ts Adds PATH export support.
src/​logger-provider.ts Extends the logger interface for PATH updates.
src/​license-client.ts Adds CLI-first licensing, fallback discovery, and redaction.
src/​index.ts Exports the new CLI and installer APIs.
src/​github-actions-ci.ts Adds PATH exports and environment newline guards.
src/​cli.ts Replaces retired commands with the v4 command surface.
src/​android-sdk.ts Retries Android SDK package installation.
README.md Documents v4 usage, migration, and maintenance scope.
package.json Sets version 4.0.0 and revises dependencies.
package-lock.json Synchronizes dependency changes.
jest.config.mjs Removes ASAR mock mapping.
docs/​unity-version-support.md Replaces Hub-specific wording.
.github/​workflows/​unity-release-discovery.yml Updates checkout and Node setup actions.
.github/​workflows/​unity-build.yml Migrates build steps to v4 and official CLI commands.
.github/​workflows/​publish.yml Updates checkout and Node setup actions.
.github/​workflows/​integration-tests.yml Updates setup and timeline actions.

Review effort: Balanced

Comment thread src/license-client.ts Outdated
Comment thread src/unity-cli.ts Outdated
Comment thread src/unity-cli.ts Outdated
Comment thread src/unity-editor.ts
Comment thread src/unity-installer.ts
Comment thread src/unity-installer.ts
Comment thread src/license-client.ts Fixed
Comment thread src/license-client.ts Fixed
Comment thread src/cli.ts Fixed
Comment thread src/unity-project.ts Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorporate the "official" unity-cli from hub Install modules based on BuildProfiles in project Get the list of downloadable templates

3 participants