An atomic GitHub Action that activates the Unity Engine license via cli with the provided secret parameters.
Part of the Mixed Reality Toolkit (XRTK) open source project.
This action does not require the use of XRTK in your Unity project.
- xrtk/unity-setup Downloads and installs the unity editor.
- xrtk/unity-action An cli tool for passing commands to the Unity Engine.
- xrtk/unity-build (Requires XRTK plugin in Unity Project)
This action uses your stored environment secrets to authenticate with the Unity Licensing servers.
It's important that you disable other forks of your repository to run actions in pull requests from unknown contributors.
Read more on Approving workflow runs from public forks
This action requires several secrets that need to be setup in the repository or organization's action secret store.
UNITY_USERNAME
The email address you use for your Unity IdUNITY_PASSWORD
The password you use for Unity Id accessUNITY_SERIAL
Optional, but required for pro/plus activationsUNITY_2FA_KEY
Optional, but required for personal activations 2FA Auth Key Setup Steps
Don't forget that pro/plus licenses only support 2 active licenses at a time!
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 2 # Use this if you're activating pro license with matrix
matrix:
include:
- os: ubuntu-latest
build-targets: StandaloneLinux64
- os: windows-latest
build-targets: StandaloneWindows64
- os: macos-latest
build-targets: StandaloneOSX
steps:
- name: checkout self
uses: actions/checkout@v4
# Installs the Unity Editor based on your project version text file
# sets -> env.UNITY_EDITOR_PATH
# sets -> env.UNITY_PROJECT_PATH
# https://github.com/XRTK/unity-setup
- uses: xrtk/unity-setup@v7
with:
build-targets: ${{ matrix.build-target }}
# Activates the installation with the provided credentials
- uses: xrtk/activate-unity-license@v5.1
with:
# Required
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# Optional
license-type: 'Professional' # Chooses license type to use [ Personal, Professional ]
serial: ${{ secrets.UNITY_SERIAL }} # Required for pro/plus activations
auth-key: ${{ secrets.UNITY_2FA_KEY }} # required for personal activations
To activate new two factor authentication for your Unity account:
- Login to Unity account and navigate to
Security
- Click
+
(activate) next toTwo Factor Authentication
- Select
Start setup
- Input password if prompted
- Select
Authenticator App
to receive codes, thenNext
- Click
Can't Scan the barcode?
- Copy the 16 character key
- Create new secret
UNITY_2FA_KEY
and save the generated key from the previous step - Scan the QR code in your Authenticator app and verify the code.