Update exit code name, set default exit code to -1 to make bugs obvious

This commit is contained in:
Andrew Kahr 2023-11-27 22:48:02 -08:00
parent f7d4ece67f
commit 9413908134
5 changed files with 9 additions and 4 deletions

View File

@ -261,6 +261,11 @@ outputs:
description: 'The generated version used for the Unity build' description: 'The generated version used for the Unity build'
androidVersionCode: androidVersionCode:
description: 'The generated versionCode used for the Android Unity build' description: 'The generated versionCode used for the Android Unity build'
engineExitCode:
description:
'Returns the exit code from the build scripts. This code is 0 if the build was successful. If there was an error
during activation, the code is from the activation step. If activation is successful, the code is from the project
build step.'
branding: branding:
icon: 'box' icon: 'box'
color: 'gray-dark' color: 'gray-dark'

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -19,7 +19,7 @@ async function runMain() {
const buildParameters = await BuildParameters.create(); const buildParameters = await BuildParameters.create();
const baseImage = new ImageTag(buildParameters); const baseImage = new ImageTag(buildParameters);
let exitCode = 0; let exitCode = -1;
if (buildParameters.providerStrategy === 'local') { if (buildParameters.providerStrategy === 'local') {
core.info('Building locally'); core.info('Building locally');
@ -39,7 +39,7 @@ async function runMain() {
// Set output // Set output
await Output.setBuildVersion(buildParameters.buildVersion); await Output.setBuildVersion(buildParameters.buildVersion);
await Output.setAndroidVersionCode(buildParameters.androidVersionCode); await Output.setAndroidVersionCode(buildParameters.androidVersionCode);
await Output.setExitCode(exitCode); await Output.setEngineExitCode(exitCode);
if (exitCode !== 0) { if (exitCode !== 0) {
core.setFailed(`Build failed with exit code ${exitCode}`); core.setFailed(`Build failed with exit code ${exitCode}`);

View File

@ -9,8 +9,8 @@ class Output {
core.setOutput('androidVersionCode', androidVersionCode); core.setOutput('androidVersionCode', androidVersionCode);
} }
static async setExitCode(exitCode: number) { static async setEngineExitCode(exitCode: number) {
core.setOutput('exitCode', exitCode); core.setOutput('engineExitCode', exitCode);
} }
} }