diff --git a/dist/index.js b/dist/index.js index f55c9a57..08c80b07 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index c72ad08f..6266331f 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/dist/platforms/ubuntu/steps/activate.sh b/dist/platforms/ubuntu/steps/activate.sh index 61c649d7..efe95b83 100755 --- a/dist/platforms/ubuntu/steps/activate.sh +++ b/dist/platforms/ubuntu/steps/activate.sh @@ -35,12 +35,13 @@ if [[ -n "$UNITY_SERIAL" && -n "$UNITY_EMAIL" && -n "$UNITY_PASSWORD" ]]; then echo "Activation successful" break else - echo "Activation failed, retrying in $delay seconds..." - sleep $delay - # Increment retry count ((retry_count++)) + echo "::warning ::Activation failed, attempting retry #$retry_count" + echo "Activation failed, retrying in $delay seconds..." + sleep $delay + # Double the delay for the next iteration delay=$((delay * 2)) fi diff --git a/src/index.ts b/src/index.ts index 2457eb1d..413ace33 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,18 +19,19 @@ async function runMain() { const buildParameters = await BuildParameters.create(); const baseImage = new ImageTag(buildParameters); + let exitCode = 0; + if (buildParameters.providerStrategy === 'local') { core.info('Building locally'); await PlatformSetup.setup(buildParameters, actionFolder); - if (process.platform === 'darwin') { - MacBuilder.run(actionFolder); - } else { - await Docker.run(baseImage.toString(), { - workspace, - actionFolder, - ...buildParameters, - }); - } + exitCode = + process.platform === 'darwin' + ? await MacBuilder.run(actionFolder) + : await Docker.run(baseImage.toString(), { + workspace, + actionFolder, + ...buildParameters, + }); } else { await CloudRunner.run(buildParameters, baseImage.toString()); } @@ -38,6 +39,7 @@ async function runMain() { // Set output await Output.setBuildVersion(buildParameters.buildVersion); await Output.setAndroidVersionCode(buildParameters.androidVersionCode); + await Output.setExitCode(exitCode); } catch (error) { core.setFailed((error as Error).message); } diff --git a/src/model/docker.ts b/src/model/docker.ts index 50cbf69f..815bccae 100644 --- a/src/model/docker.ts +++ b/src/model/docker.ts @@ -16,7 +16,7 @@ class Docker { options: ExecOptions | undefined = undefined, entrypointBash: boolean = false, errorWhenMissingUnityBuildResults: boolean = false, - ) { + ): Promise { let runCommand = ''; switch (process.platform) { case 'linux': @@ -27,9 +27,10 @@ class Docker { } if (options) { options.silent = silent; - await execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults); + + return await execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults); } else { - await execWithErrorCheck(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults); + return await execWithErrorCheck(runCommand, undefined, { silent }, errorWhenMissingUnityBuildResults); } } diff --git a/src/model/mac-builder.ts b/src/model/mac-builder.ts index eb9ec683..7524f961 100644 --- a/src/model/mac-builder.ts +++ b/src/model/mac-builder.ts @@ -1,8 +1,8 @@ import { execWithErrorCheck } from './exec-with-error-check'; class MacBuilder { - public static async run(actionFolder: string, silent: boolean = false) { - await execWithErrorCheck('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], { + public static async run(actionFolder: string, silent: boolean = false): Promise { + return await execWithErrorCheck('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], { silent, }); } diff --git a/src/model/output.ts b/src/model/output.ts index 1d71bf86..2169e3b2 100644 --- a/src/model/output.ts +++ b/src/model/output.ts @@ -8,6 +8,10 @@ class Output { static async setAndroidVersionCode(androidVersionCode: string) { core.setOutput('androidVersionCode', androidVersionCode); } + + static async setExitCode(exitCode: number) { + core.setOutput('exitCode', exitCode); + } } export default Output;