Update exit code name, set default exit code to -1 to make bugs obvious
parent
f7d4ece67f
commit
9413908134
|
@ -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'
|
||||||
|
|
|
@ -49,7 +49,7 @@ async function runMain() {
|
||||||
const { workspace, actionFolder } = model_1.Action;
|
const { workspace, actionFolder } = model_1.Action;
|
||||||
const buildParameters = await model_1.BuildParameters.create();
|
const buildParameters = await model_1.BuildParameters.create();
|
||||||
const baseImage = new model_1.ImageTag(buildParameters);
|
const baseImage = new model_1.ImageTag(buildParameters);
|
||||||
let exitCode = 0;
|
let exitCode = -1;
|
||||||
if (buildParameters.providerStrategy === 'local') {
|
if (buildParameters.providerStrategy === 'local') {
|
||||||
core.info('Building locally');
|
core.info('Building locally');
|
||||||
await platform_setup_1.default.setup(buildParameters, actionFolder);
|
await platform_setup_1.default.setup(buildParameters, actionFolder);
|
||||||
|
@ -68,7 +68,7 @@ async function runMain() {
|
||||||
// Set output
|
// Set output
|
||||||
await model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
await model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
||||||
await model_1.Output.setAndroidVersionCode(buildParameters.androidVersionCode);
|
await model_1.Output.setAndroidVersionCode(buildParameters.androidVersionCode);
|
||||||
await model_1.Output.setExitCode(exitCode);
|
await model_1.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}`);
|
||||||
}
|
}
|
||||||
|
@ -7008,8 +7008,8 @@ class Output {
|
||||||
static async setAndroidVersionCode(androidVersionCode) {
|
static async setAndroidVersionCode(androidVersionCode) {
|
||||||
core.setOutput('androidVersionCode', androidVersionCode);
|
core.setOutput('androidVersionCode', androidVersionCode);
|
||||||
}
|
}
|
||||||
static async setExitCode(exitCode) {
|
static async setEngineExitCode(exitCode) {
|
||||||
core.setOutput('exitCode', exitCode);
|
core.setOutput('engineExitCode', exitCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports["default"] = Output;
|
exports["default"] = Output;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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}`);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue