Skip to content

Use Unity CLI for gated tests and GitHub App releases - #106

Merged
mackysoft merged 9 commits into
mainfrom
ci/unity-cli-workflows
Oct 14, 2026
Merged

mackysoft merged 9 commits into
mainfrom
ci/unity-cli-workflows

Conversation

@mackysoft

@mackysoft mackysoft commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Use Unity CLI for applicable Linux EditMode tests and the final Verification check. Build the example player and export the package during manual Release runs.
  • Release accepts a package version, updates package.json through the MackySoft Release GitHub App, and builds that exact commit before creating its tag and draft release.

Scope

  • Add a shared Ubuntu 22.04 setup action with Unity CLI pinned to 1.0.0-beta.12. Activate a license on each runner using UNITY_EMAIL and UNITY_PASSWORD, verify active license state, and return the license after activation. Desktop-bound UNITY_LICENSE files are no longer imported.
  • Detect Unity source, assets, project settings, and test setup changes. Run Linux EditMode tests on Unity 2021.3.45f2 and 2023.2.22f1 when required; documentation-only changes can skip Unity tests.
  • Always report Verification. Successful detection and required test success, or an intentional skip when tests are unnecessary, passes. Failed detection and failed, cancelled, or unexpectedly skipped required tests fail the check.
  • Remove the separate Build and Export Package workflows. Manual Release builds the Linux 64-bit example player and exports .unitypackage, retaining logs and artifacts.
  • Use repository-scoped App tokens in the version preparation and publication jobs. Each job owns its token; build and publication receive the same commit SHA. Pass the publisher's App token explicitly to the Release action.
  • Validate SemVer and Git refs before changing the manifest. Commit only the package manifest, require a fast-forward from the checked-out source with the remote still at its expected SHA, reuse matching lightweight or annotated tags, and reject conflicting tags.
  • Document the App configuration in AGENTS.md and remove the obsolete Build badge from the root README. Unity source and tests are unchanged. The App ID and private-key secret are registered, the repository is included in the App installation, and its bypass applies only to the PR rule; deletion and non-fast-forward protection remain enforced.

Verification

  • Latest commit 213f64c passed in the pull request workflow and push workflow on Ubuntu 22.04, including activation, license return, and final Verification. Downloaded NUnit artifacts confirm 22/22 tests passed on Unity 2021.3.45f2 and 25/25 passed on Unity 2023.2.22f1 in each run, with no failures or skips.
  • Local Unity CLI runs passed both EditMode suites. The Unity 2021.3.45f2 Linux x86-64 cross-build and .unitypackage export succeeded, and both artifacts were inspected.
  • Isolated Git checks passed 13 preparation/tag cases and 27 correction cases, covering version and SHA consistency, retries, tag conflicts, valid and invalid SemVer, and concurrent branch advancement, deletion, or rollback. The Release action's token selection was also verified using its actual parser without network requests.
  • actionlint, ShellCheck, shell syntax, YAML parsing, and git diff --check passed. Nine change-filter cases and nine final-check cases produced the expected results; an earlier hosted failure confirmed that activation failure fails Verification.
  • Two independent reviewers completed the full change and subsequent corrections. A real App installation token was authenticated, limited to this repository with contents:write, and revoked after verification. Both reviewers independently checked the PR exception and preserved branch protections.
  • Release has not been dispatched. Actual App writes to the source branch, tag creation, and draft release creation remain untested.

Why
Use Unity CLI to manage the Editor and license directly, and focus CI on the supported Editor behavior and one player target.

What Changed
Replace GameCI steps with a shared Unity setup action and direct test, build, and package export commands. Keep EditMode coverage on Unity 2021.3 and 2023.2, reduce player builds to Linux 64-bit, retain logs and artifacts, and update the CI instructions.

Impact
UNITY_LICENSE is the only Unity secret consumed by the workflows. Fork pull requests continue to receive no repository secrets. Local validation passed both EditMode suites, the Linux player build, package export, and workflow linting; hosted-runner validation follows in the PR.
Why
Routine pushes and pull requests need EditMode coverage without the cost of player builds and package exports.

What Changed
Remove the standalone Build and Export Package workflows. Run the Linux example build and package export together in the manually dispatched Release workflow, and align the CI instructions.

Impact
Push and pull-request workflows run EditMode tests only. Release creation still requires a successful player build and package export.
@mackysoft mackysoft changed the title Run CI with Unity CLI Use Unity CLI and build only during releases Oct 13, 2026
Why
Branch rulesets need one stable status check that succeeds only after every required verification job has passed.

What Changed
Add a final Verification job that always runs after the EditMode matrix and fails unless the matrix result is success. Keep the existing push branch exclusions and document the check's contract.

Impact
A failed, cancelled, or skipped EditMode matrix cannot produce a successful Verification check. Validated all four dependency-result cases and workflow linting.
Why
Required checks must report a result for documentation-only pull requests without treating missing required test results as successful.

What Changed
Detect Unity project and test setup changes before the EditMode matrix, and always evaluate the detection result and applicable test outcomes in Verification. Remove the badge for the deleted Build workflow.

Impact
Documentation-only pull requests can pass without starting Unity. Detection failures and failed, cancelled, or unexpectedly skipped required tests still fail Verification.
@mackysoft mackysoft changed the title Use Unity CLI and build only during releases Use Unity CLI with a final verification check and release-only builds Oct 13, 2026
Why
A missing change-filter output must not be interpreted as tests being unnecessary, and an invalid license should fail before downloading an Editor.

What Changed
Preserve the exact filter output for Verification and activate the Unity license before installing the requested Editor.

Impact
Unknown validation requirements fail the final check. License failures avoid the expensive Editor download.
Why
Desktop license files cannot be imported on ephemeral GitHub runners because their machine bindings differ.

What Changed
Use the existing Unity account secrets with the Editor's licensing client, verify the resulting license state, and return active licenses after each job.

Impact
Unity CLI still installs Editors and runs tests, builds, and exports. CI activation no longer depends on a desktop-bound UNITY_LICENSE file, and failures continue to block Verification.
Why
Both hosted EditMode suites pass, but Unity CLI rejects returning the Personal license activated by the bundled client.

What Changed
Return the runner's license using the bundled licensing client and use the Editor's credentialed return for entitlement licenses without a ULF file.

Impact
Test and release jobs share bounded cleanup after activation, including failed runs. License return failures remain visible and prevent Verification from passing.
Why
The required pull request ruleset prevents Release from pushing a package version commit directly to main, blocking the Linux build and package export.

What Changed
Read the version and SHA from the dispatched commit, build that exact SHA, and create only its version tag after the build succeeds. Reject tags for different commits and document version updates through pull requests.

Impact
Release works with protected main. Maintainers merge the package version update before dispatching Release; write permission is limited to the release publisher.
@mackysoft mackysoft changed the title Use Unity CLI with a final verification check and release-only builds Use Unity CLI for gated tests and releases from committed versions Oct 14, 2026
Why
Release needs the GitHub App's pull request exception to update its package version on a protected branch.

What Changed
Restore the version tag input and use repository-scoped App tokens for version commits, tags, and draft releases. Validate SemVer before editing the manifest and require a conditional fast-forward from the checked-out source. Build and publication share the prepared commit SHA.

Impact
Maintainers can release through one manual workflow. Concurrent branch changes and conflicting tags fail without replacing remote state, and each writing job owns its token.
@mackysoft mackysoft changed the title Use Unity CLI for gated tests and releases from committed versions Use Unity CLI for gated tests and GitHub App releases Oct 14, 2026
@mackysoft
mackysoft merged commit 0cddef4 into main Oct 14, 2026
12 checks passed
@mackysoft
mackysoft deleted the ci/unity-cli-workflows branch October 14, 2026 17:50
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.

1 participant