Activation
The orb uses a Unity Editor instance to test and build your projects. Before each job, the orb activates Unity with your Unity account email, password and serial.
Unity separates its licenses between Personal and Professional. The former applies to the free
and the latter to the Pro and Plus versions. Based on your use case proceed to the
Personal or Professional license section.
Personal license
Follow these steps if you are using Unity's free version.
Note: Do NOT follow the steps for the personal license if you have a professional license.
Personal licenses have no serial key. The orb extracts it from your Unity license file (.ulf).
Getting the license file
Install Unity Hub on your machine and log in with the Unity account you want to use in CI.
Go to
Unity Hub⇢Preferences⇢Licenses, clickAddand select Get a free personal license. Even if a license is already listed, clickAddto make sure the file gets created.Find the
Unity_lic.ulffile:- Windows:
C:\ProgramData\Unity\Unity_lic.ulf - Mac:
/Library/Application Support/Unity/Unity_lic.ulf - Linux:
~/.local/share/unity3d/Unity/Unity_lic.ulf
The license isn't tied to an operating system: you can get it on Windows or macOS and use it in Ubuntu jobs.
- Windows:
Encoding the license
CircleCI environment variables work best on a single line, so encode the file to base64:
# Linux
base64 -w 0 Unity_lic.ulf
# macOS
base64 -i Unity_lic.ulf
Configuring your Context
- Navigate to CircleCI ⇢
Organization Settings⇢Contexts⇢Create Contextand choose a name for your context (e.g.unity). Alternatively, open an existing Context that you would like to use. - Create the following environment variables:
UNITY_LICENSE- (Paste the encoded license from the previous step)UNITY_EMAIL- (Add the email address that you use to log in to Unity)UNITY_PASSWORD- (Add the password that you use to log in to Unity)
Professional license
Follow these steps if you are using Unity's Pro or Plus version.
Note: Do NOT follow the steps for the professional license if you have a personal license.
- Get your Serial Key from the subscriptions page.
- Navigate to CircleCI ⇢
Organization Settings⇢Contexts⇢Create Contextand choose a name for your context (e.g.unity). Alternatively, open an existing Context that you would like to use. - Create the following environment variables:
UNITY_SERIAL- (Paste the serial acquired in step 1 here. It should look like this:XX-XXXX-XXXX-XXXX-XXXX-XXXX)UNITY_EMAIL- (Add the email address that you use to log in to Unity)UNITY_PASSWORD- (Add the password that you use to log in to Unity)
GameCI does not acquire nor store your Unity email, password, serial or license file. They are only used to activate Unity during your jobs.
Upgrading from version 1.x
Version 2 activates Unity the same way as the GitHub Actions. Unity no longer supports manual
activation with .alf files, so the old personal license flow stopped working.
- Rename
unity-username-var-nametounity-email-var-name. Its default is nowUNITY_EMAIL. - The
unity/create-activation-filejob was removed. Get a license file as described in Personal license. unity-license-var-namenow defaults toUNITY_LICENSE. An existingUNITY_ENCODED_LICENSEvariable still works if you passunity-license-var-name: 'UNITY_ENCODED_LICENSE'. Email and password are now required for personal licenses too.fetch-submodulesnow defaults totrue, since 1.x always fetched submodules.- The
unity/macosexecutor only accepts them4pro.mediumandm4pro.largeresource classes, since CircleCI retired the M1 machines. - On macOS, the Editor is now installed with the
Unity CLI instead of the Unity Hub (from
orb 2.0.1).
UNITY_HUB_PATHis no longer exported; custom steps that ran"$UNITY_HUB_PATH" -- --headless install-modules ...should run"$UNITY_CLI_PATH" install-modules -e <version> -m <module>instead. See Unity's migration guide.
Next steps
Now you are prepared to start testing and building your Unity project. However, remember to reference your context in every job you run; otherwise, they will fail:
version: 2.1
orbs:
unity: game-ci/unity@2
workflows:
build-unity-project:
jobs:
- unity/test:
...
context: unity
- unity/build:
...
context: unity