diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index f3fc91d..65d96c5 100644 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -13,7 +13,15 @@ ACTIVATE_MAX_ATTEMPTS="${UNITY_LICENSE_RETRY_MAX_ATTEMPTS:-4}" ACTIVATE_RETRY_DELAY_SECONDS=20 ACTIVATE_TRANSIENT_LICENSE_ERROR_PATTERN='TimeoutPolicy did not complete|Access token is unavailable|entitlement groups and 0 free entitlements|License activation has failed|No valid Unity Editor license found|License is not active' -if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then +# Serial mode is preferred over personal-license (below) whenever both are +# configured: a manually-activated .ulf is bound to the machine fingerprint +# of whatever machine originally requested it, which real CI evidence shows +# genuinely doesn't match every runner - confirmed via unity-test-runner's +# own CI, where the identical .ulf activates cleanly through this same +# script's ubuntu counterpart but fails windows with "Machine bindings +# don't match" every single time. Serial credentials have no such +# constraint, so given a choice, prefer them. +if [[ -z "$UNITY_SERIAL" || -z "$UNITY_EMAIL" || -z "$UNITY_PASSWORD" ]] && { [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; }; then # # PERSONAL LICENSE MODE # diff --git a/dist/platforms/ubuntu/steps/activate.sh b/dist/platforms/ubuntu/steps/activate.sh index c451755..5b91ea0 100644 --- a/dist/platforms/ubuntu/steps/activate.sh +++ b/dist/platforms/ubuntu/steps/activate.sh @@ -12,7 +12,12 @@ UNITY_ACTIVATE_MAX_ATTEMPTS="${UNITY_LICENSE_RETRY_MAX_ATTEMPTS:-4}" UNITY_ACTIVATE_RETRY_DELAY_SECONDS=20 UNITY_ACTIVATE_TRANSIENT_PATTERN='TimeoutPolicy did not complete|Access token is unavailable|entitlement groups and 0 free entitlements|License activation has failed|No valid Unity Editor license found|License is not active' -if [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; then +# Serial mode is preferred over personal-license (below) whenever both are +# configured - see mac/steps/activate.sh's matching comment: a manually- +# activated .ulf is bound to the machine fingerprint of whatever machine +# originally requested it, which doesn't necessarily match every runner. +# Serial credentials have no such constraint, so given a choice, prefer them. +if [[ -z "$UNITY_SERIAL" || -z "$UNITY_EMAIL" || -z "$UNITY_PASSWORD" ]] && { [[ -n "$UNITY_LICENSE" ]] || [[ -n "$UNITY_LICENSE_FILE" ]]; }; then # # PERSONAL LICENSE MODE # diff --git a/dist/platforms/windows/activate.ps1 b/dist/platforms/windows/activate.ps1 index 89d6242..59acb9f 100644 --- a/dist/platforms/windows/activate.ps1 +++ b/dist/platforms/windows/activate.ps1 @@ -19,7 +19,16 @@ $MaxAttempts = if ($Env:UNITY_LICENSE_RETRY_MAX_ATTEMPTS) { [int]$Env:UNITY_LICE $RetryDelaySeconds = 20 $TransientPattern = 'TimeoutPolicy did not complete|Access token is unavailable|entitlement groups and 0 free entitlements|License activation has failed|No valid Unity Editor license found|License is not active' -if ($Env:UNITY_LICENSE -or $Env:UNITY_LICENSE_FILE) { +# Serial mode is preferred over personal-license (below) whenever both are +# configured - see mac/steps/activate.sh's matching comment: a manually- +# activated .ulf is bound to the machine fingerprint of whatever machine +# originally requested it, which real CI evidence shows genuinely doesn't +# match every runner (confirmed "Machine bindings don't match" on windows +# specifically, with the identical .ulf activating cleanly elsewhere). +# Serial credentials have no such constraint, so given a choice, prefer them. +$HasSerialCredentials = $Env:UNITY_SERIAL -and $Env:UNITY_EMAIL -and $Env:UNITY_PASSWORD + +if ((-not $HasSerialCredentials) -and ($Env:UNITY_LICENSE -or $Env:UNITY_LICENSE_FILE)) { # # PERSONAL LICENSE MODE #