Automate Personal License Activation in Unity CI
Following up the thread, My disappointing experience using Unity in a CI pipeline
is also the biggest obstacle for me as well. Personal license (free version) of
Unity will expire in a period of time depends on your region. The licensing system
from Unity is partially contradict to the CI/CD concept since it will force
the user to update their secret
UNITY_LICENSE on their GitHub Actions. (Notice
this does not apply to Plus/Pro users because they use a different licensing system!)
Next step, we just have to update our secret
UNITY_LICENSE through GitHub’s API!
The tasks are simple, we only need two following GitHub actions.
We can use
read-file-action to read the downloaded
.ulf file into memory, then we
can use that as a value for our
actions-set-secrets. Make sure you have added a secret
ACCESS_TOKEN to your repository environment. It’s needed for creating/updating your
GitHub secret from the workflow!
The full workflow file can be accessed through here.
🔐 Two Factor Authentication (TFA)
unity-license-activate may not work since Unity would require you to enter a 6 digit verification code from your email. To get pass this, you would have to install unity-verify-code in your workflow and follow the steps here.