diff --git a/dist/BlankProject/ProjectSettings/XRSettings.asset b/dist/BlankProject/ProjectSettings/XRSettings.asset deleted file mode 100644 index 482590c1..00000000 --- a/dist/BlankProject/ProjectSettings/XRSettings.asset +++ /dev/null @@ -1,10 +0,0 @@ -{ - "m_SettingKeys": [ - "VR Device Disabled", - "VR Device User Alert" - ], - "m_SettingValues": [ - "False", - "False" - ] -} \ No newline at end of file diff --git a/dist/platforms/mac/entrypoint.sh b/dist/platforms/mac/entrypoint.sh index 80ec6d09..bea8f36a 100755 --- a/dist/platforms/mac/entrypoint.sh +++ b/dist/platforms/mac/entrypoint.sh @@ -41,7 +41,7 @@ echo "" echo "Please note that the exit code is not very descriptive." echo "Most likely it will not help you solve the issue." echo "" -echo "To find the reason for failure: please search for errors in the log above." +echo "To find the reason for failure: please search for errors in the log above and check for annotations in the summary view." echo "" fi; diff --git a/dist/platforms/mac/steps/activate.sh b/dist/platforms/mac/steps/activate.sh index 2d3339ef..3f749f04 100755 --- a/dist/platforms/mac/steps/activate.sh +++ b/dist/platforms/mac/steps/activate.sh @@ -20,10 +20,6 @@ echo "Requesting activation" # Store the exit code from the verify command UNITY_EXIT_CODE=$? -if [ ! -f "/Library/Application Support/Unity/Unity_lic.ulf" ]; then - echo "::error ::There was an error while trying to activate the Unity license." -fi - # # Display information about the result # diff --git a/dist/platforms/ubuntu/steps/activate.sh b/dist/platforms/ubuntu/steps/activate.sh index 302ab531..61c649d7 100755 --- a/dist/platforms/ubuntu/steps/activate.sh +++ b/dist/platforms/ubuntu/steps/activate.sh @@ -4,24 +4,51 @@ if [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then # # SERIAL LICENSE MODE # - # This will activate unity, using the activating process. + # This will activate unity, using the serial activation process. # echo "Requesting activation" - # Activate license - unity-editor \ - -logFile /dev/stdout \ - -quit \ - -serial "$UNITY_SERIAL" \ - -username "$UNITY_EMAIL" \ - -password "$UNITY_PASSWORD" \ - -projectPath "/BlankProject" + # Loop the unity-editor call until the license is activated with exponential backoff and a maximum of 5 retries + retry_count=0 - # Store the exit code from the verify command - UNITY_EXIT_CODE=$? + # Initialize delay to 15 seconds + delay=15 - if [ ! -f "~/.local/share/unity3d/Unity/Unity_lic.ulf" ]; then - echo "::error ::There was an error while trying to activate the Unity license." + # Loop until UNITY_EXIT_CODE is 0 or retry count reaches 5 + while [[ $retry_count -lt 5 ]] + do + # Activate license + unity-editor \ + -logFile /dev/stdout \ + -quit \ + -serial "$UNITY_SERIAL" \ + -username "$UNITY_EMAIL" \ + -password "$UNITY_PASSWORD" \ + -projectPath "/BlankProject" + + # Store the exit code from the verify command + UNITY_EXIT_CODE=$? + + # Check if UNITY_EXIT_CODE is 0 + if [[ $UNITY_EXIT_CODE -eq 0 ]] + then + echo "Activation successful" + break + else + echo "Activation failed, retrying in $delay seconds..." + sleep $delay + + # Increment retry count + ((retry_count++)) + + # Double the delay for the next iteration + delay=$((delay * 2)) + fi + done + + if [[ $retry_count -eq 5 ]] + then + echo "Activation failed after 5 retries" fi elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then @@ -50,8 +77,9 @@ else echo "Visit https://game.ci/docs/github/getting-started for more" echo "details on how to set up one of the possible activation strategies." - echo "::error ::No valid license activation strategy could be determined." - # Immediately exit as no UNITY_EXIT_CODE can be derrived. + echo "::error ::No valid license activation strategy could be determined. Make sure to provide UNITY_EMAIL, UNITY_PASSWORD, and either a UNITY_SERIAL \ +or UNITY_LICENSE. Otherwise please use UNITY_LICENSING_SERVER." + # Immediately exit as no UNITY_EXIT_CODE can be derived. exit 1; fi @@ -66,6 +94,7 @@ else # Activation failed so exit with the code from the license verification step echo "Unclassified error occured while trying to activate license." echo "Exit code was: $UNITY_EXIT_CODE" + echo "::error ::There was an error while trying to activate the Unity license." exit $UNITY_EXIT_CODE fi diff --git a/dist/platforms/ubuntu/steps/runsteps.sh b/dist/platforms/ubuntu/steps/runsteps.sh index 62044aa9..e8376051 100644 --- a/dist/platforms/ubuntu/steps/runsteps.sh +++ b/dist/platforms/ubuntu/steps/runsteps.sh @@ -6,6 +6,12 @@ source /steps/set_extra_git_configs.sh source /steps/set_gitcredential.sh source /steps/activate.sh + +# If we didn't activate successfully, exit with the exit code from the activation step. +if [[ $UNITY_EXIT_CODE -ne 0 ]]; then + exit $UNITY_EXIT_CODE +fi + source /steps/build.sh source /steps/return_license.sh @@ -22,7 +28,7 @@ echo "" echo "Please note that the exit code is not very descriptive." echo "Most likely it will not help you solve the issue." echo "" -echo "To find the reason for failure: please search for errors in the log above." +echo "To find the reason for failure: please search for errors in the log above and check for annotations in the summary view." echo "" fi; diff --git a/dist/platforms/windows/activate.ps1 b/dist/platforms/windows/activate.ps1 index 5e505b46..897ec17e 100644 --- a/dist/platforms/windows/activate.ps1 +++ b/dist/platforms/windows/activate.ps1 @@ -13,7 +13,4 @@ Write-Output "" -projectPath "c:/BlankProject" ` -logfile - | Out-Host -if(-not(Test-path "C:/ProgramData/Unity/Unity_lic.ulf" -PathType leaf)) -{ - Write-Output "::error ::There was an error while trying to activate the Unity license." -} +$ACTIVATION_EXIT_CODE = $LASTEXITCODE diff --git a/dist/platforms/windows/entrypoint.ps1 b/dist/platforms/windows/entrypoint.ps1 index 07cbb070..fac75b74 100644 --- a/dist/platforms/windows/entrypoint.ps1 +++ b/dist/platforms/windows/entrypoint.ps1 @@ -1,5 +1,4 @@ Get-Process -Start-Sleep -Seconds 3 # Import any necessary registry keys, ie: location of windows 10 sdk # No guarantee that there will be any necessary registry keys, ie: tvOS @@ -17,13 +16,17 @@ Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force } # Activate Unity . "c:\steps\activate.ps1" +# If we didn't activate successfully, exit with the exit code from the activation step. +if ($ACTIVATION_EXIT_CODE -ne 0) { + exit $ACTIVATION_EXIT_CODE +} + # Build the project . "c:\steps\build.ps1" # Free the seat for the activated license . "c:\steps\return_license.ps1" -Start-Sleep -Seconds 3 Get-Process exit $BUILD_EXIT_CODE