Repository navigation
Sign release builds in a protected release job - #25
Merged
Merged
Conversation
…bles CommandLineBuild.BuildAndroidQuest now reads the signing variables that GameCI passes into its build container, so local and CI builds use one set of names: ANDROID_KEYSTORE_NAME (the keystore path; a relative path resolves against the project folder, where GameCI decodes ANDROID_KEYSTORE_BASE64), ANDROID_KEYSTORE_PASS, ANDROID_KEYALIAS_NAME and ANDROID_KEYALIAS_PASS. - -release still fails unless all four are set and the keystore exists. It now also fails while a build profile is active, because Unity would then read and write the profile's copy of Player Settings. - versionCode has one source: Player Settings > Version (bundleVersion), as MAJOR*1000000 + MINOR*1000 + PATCH. VERSION_CODE and VERSION_NAME are no longer read. - KEYSTORE_PATH, KEYSTORE_PASS, KEY_ALIAS and KEY_PASS are retired rather than kept as fallbacks: the build warns when one is set, and a -release build that has only those fails and names the replacements. - After a signed build, every file under Library/Bee in which Unity's Gradle export left a password in plain text is deleted; only file names are logged. - Debug-signed builds are unchanged. The README documents signed APK and AAB builds from the command line with a temporary GRADLE_USER_HOME, how to check the signature, and the release keystore of the contract (companion-scan-release.p12, PKCS12, RSA 4096, alias companion-scan). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
unity-builder v5.0.1 and unity-test-runner v4.3.2 activate only a paid seat with a serial key, and a Unity Personal .ulf no longer activates Unity 6000.6 in CI. Move both Unity workflows to unity-builder v6.0.0 and unity-test-runner v4.4.0 with game-ci/cli pinned to v0.1.72, which activates Personal from UNITY_EMAIL and UNITY_PASSWORD, plus UNITY_SERIAL for a paid seat. - UNITY_LICENSE is no longer passed. The Quest APK Build warns while it is set, and stops early when UNITY_PASSWORD holds " or \, which GameCI cannot pass to docker. - The Quest APK Build removes stale editor PID files from a restored Library before Unity starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During a signed build Unity 6000.6.9f1 writes the keystore and key passwords in plain text into Library/Bee and into compiled build scripts in Gradle's home, and anyone who can open a pull request can read this public repository's Actions caches. quest-build.yml signed in the job that also saved the Library cache, so setting the ANDROID_* secrets would have published the passwords. The workflow now has a plan job and two build jobs: - debug: manual runs on a branch. It never references the ANDROID_* secrets, signs with a debug key made for the run, and is the only job that saves the Library cache. - release: v* tags on main, and manual runs on main with "release" or on a v* tag. It runs in the "release" environment, requires the passwords to be at least 20 letters and digits, builds with -release, restores the Library cache read-only, and never saves a cache or uploads Library. When the build step ends, also after a failure, it deletes the decoded keystore, Library/Bee and $HOME/.gradle: game-ci/cli runs the editor container as root with the runner's home folder mounted as /root, so Gradle's home /root/.gradle is $HOME/.gradle on the runner. It then searches the workspace and the runner's home folder for both passwords in plain text (grep reads them on standard input; only file names are printed) and fails the job, before the package is uploaded, if a file still holds one. Both jobs run CommandLineBuild.BuildAndroidQuest, so CI takes its version from bundleVersion (a tag must be v<bundleVersion> and on main) and can build an AAB (package=aab). .github/scripts/check-quest-package.sh checks the package with the Unity image's tools: versionCode, versionName and target API level 34; an APK must verify with a v2 signature; a release package must not carry the Android debug certificate. The certificate SHA-256 goes into the run summary. The README describes the release environment to create first (required reviewers, main and v* only, optionally the ANDROID_* secrets as environment secrets), the two jobs, the cache rule, and how to release a version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ver retention (#29) README.md conflicted in two places: keep this branch's release-build text (signing from GameCI's environment names, versionCode from bundleVersion) with the artifact names main's command-line build now writes, Builds/Android/CompanionScan.apk and .aab. The signature-check commands in the README and docs/SIDELOAD.md named the old CompanionCapture artifacts too and are updated the same way. The workflows pick packages up by dist/*.apk and dist/*.aab, so they need no change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI can now sign Quest builds with the release key without exposing the key's passwords, and it can activate a Unity Personal licence.
During a signed build, Unity 6000.6.9f1 writes the keystore and key passwords in plain text into
Library/Beeand into compiled build scripts in Gradle's home. Onmain,quest-build.ymlsigns in the same job that saves theLibrarycache, and anyone who can open a pull request can read this public repository's Actions caches. Adding theANDROID_*secrets today would therefore publish the passwords. With this PR, only a separate release job signs. It runs in a protectedreleaseenvironment and never saves theLibraryor Gradle cache.main@2147965:103ff8b,461196eand8f15f92. Merge them together.461196eon its own moves to the new GameCI actions but keepsmain's single job that both signs and saves the cache.ANDROID_*secrets only after this is merged.Assets/, so its own Unity Tests check is the first run of the new Unity activation. That check needsUNITY_EMAILandUNITY_PASSWORD, set as described in step 3 below.What changed
103ff8bbuild(android): one set of signing variablesCommandLineBuild.BuildAndroidQuestreadsANDROID_KEYSTORE_NAME,ANDROID_KEYSTORE_PASS,ANDROID_KEYALIAS_NAMEandANDROID_KEYALIAS_PASS. These are the names GameCI passes into its build container, so local and CI builds read the same variables. A relative keystore path is taken from the project folder.-releasestill fails unless all four are set and the keystore exists. It now also fails while a build profile is active.bundleVersion), as MAJOR×1000000 + MINOR×1000 + PATCH.VERSION_CODE,VERSION_NAMEand the oldKEYSTORE_PATH,KEYSTORE_PASS,KEY_ALIASandKEY_PASSare no longer read. The build warns when one is set, and a-releasebuild that has only the old names fails and names the new ones.Library/Beethat holds either password is deleted. Only file names are logged. Debug-signed builds are unchanged.461196eci: Unity Personal activationUNITY_EMAILandUNITY_PASSWORD, plusUNITY_SERIALfor a paid seat..ulfno longer activates 6000.6 in CI, soUNITY_LICENSEis no longer passed.UNITY_PASSWORDcontains"or\, which GameCI cannot pass to docker. It also removes stale editor PID files from a restoredLibrary.8f15f92ci(quest): sign only in a gated release jobA
planjob reads the Unity and app versions and starts one of two build jobs. A tag must bev<bundleVersion>and onmain.debugjob: manual runs on any branch. It never references theANDROID_*secrets, signs with a debug key made for the run, and is the only job that saves theLibrarycache.releasejob:v*tags onmain, manual runs onmainwith release ticked, and manual runs on av*tag.releaseenvironment and requires both passwords to be 20 or more letters and digits. It builds with-release.Librarycache read-only. It never saves aLibraryor Gradle cache and never uploadsLibrary.Library/Beeand~/.gradle. GameCI mounts the runner's home folder as the container's/root, so Gradle's home ends up in~/.gradle.package=aabbuilds an App Bundle..github/scripts/check-quest-package.shchecks each package with the Unity image's own tools:The run summary shows the certificate's SHA-256.
A tag build attaches the package and its checksum to a draft GitHub Release.
The README,
docs/qa-ci.mdanddocs/SIDELOAD.mdcover the jobs, thereleaseenvironment, the secrets, local signed builds and how to release a version.Verification
Local checks used Unity 6000.6.9f1 on Windows with the Android target. The C# in this PR is byte-identical to what was tested.
AndroidReleaseSettingsTests.-releasebuild with a throwaway key made like the release keystore (PKCS12, RSA 4096, aliascompanion-scan). The passwords came from the environment, with a temporaryGRADLE_USER_HOME. The build exited 0 after 9.2 minutes and produced a 79.6 MB APK.Library/Beein 59 seconds. It deleted the 7 that held the password: the generatedlauncher/build.gradlefiles and Bee's build graph and inputs.GRADLE_USER_HOMEand the release job deletes~/.gradle. The search found no copy of the keystore file.Workflows and scripts:
sudocommand lines.check-quest-package.shbehaved as expected in 10 local cases: an APK, plus synthetic signed and unsigned AABs.Not verified
Library/Bee, whose paths are over 260 characters. It warns, and the README says to deleteLibrary/Beein that case. The release job deletesLibrary/Beeoutright.docs/qa-ci.mdsay the job "never saves a cache", read "noLibraryor Gradle cache".v0.1.72), not by commit, and it handles the release key in the release job. Approving a release run trusts that release.Owner actions after merge
Create the
releaseenvironment before any release run, because GitHub creates a missing environment without protection. Go to Settings → Environments → New environment and name itrelease. Add required reviewers, and limit deployment branches and tags tomainandv*.Store the four signing secrets in that environment, not as repository secrets: a workflow edited on any branch can read repository secrets. The README calls this optional; do it anyway. Use
gh secret set <name> --env releasefor each one:ANDROID_KEYSTORE_BASE64: the release keystore, base64 on one line;ANDROID_KEYSTORE_PASS;ANDROID_KEYALIAS_PASS: the same password, in a PKCS12 keystore;ANDROID_KEYALIAS_NAME:companion-scan.Both passwords must be 20 or more letters and digits.
Set up the Unity licence. Set
UNITY_EMAILandUNITY_PASSWORDfor a Unity ID kept for CI. It must sign in with a password and have two-factor authentication off, and its password must not contain"or\. AddUNITY_SERIALonly for a paid seat, and deleteUNITY_LICENSE.Optional: add a tag ruleset that lets only maintainers create
v*tags.Run the first builds. Run a debug build of
main(gh workflow run quest-build.yml --ref main) to check activation and fill the cache. Then run one release build (-f release=true) and approve it. Check that the certificate SHA-256 in the run summary matches your release keystore before you push the firstv*tag.🤖 Generated with Claude Code