Enable unity licensing server for Windows (#638)

* Enable unity licensing server for windows

* Clarify validating logic with explicit variables
This commit is contained in:
Pierre Lataillade
2024-03-26 20:11:33 +01:00
committed by GitHub
parent dd427466ce
commit f2250e958e
6 changed files with 51 additions and 8 deletions

View File

@@ -4,9 +4,14 @@ import { BuildParameters } from '..';
class ValidateWindows {
public static validate(buildParameters: BuildParameters) {
ValidateWindows.validateWindowsPlatformRequirements(buildParameters.targetPlatform);
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {
throw new Error(`Unity email and password must be set for Windows based builds to
authenticate the license. Make sure to set them inside UNITY_EMAIL
const { unityLicensingServer } = buildParameters;
const hasLicensingCredentials = process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD;
const hasValidLicensingStrategy = hasLicensingCredentials || unityLicensingServer;
if (!hasValidLicensingStrategy) {
throw new Error(`Unity email and password or alternatively a Unity licensing server url must be set for
Windows based builds to authenticate the license. Make sure to set them inside UNITY_EMAIL
and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);
}
}