diff --git a/action.yml b/action.yml index 1b5aff47..ef48e8c2 100644 --- a/action.yml +++ b/action.yml @@ -31,6 +31,10 @@ inputs: required: false default: '' description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.' + manualExit: + required: false + default: '' + description: 'Suppresses `-quit`. Exit your build method using `EditorApplication.Exit(0)` instead.' customParameters: required: false default: '' diff --git a/dist/index.js b/dist/index.js index 416f12b4..9846f22a 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 5ae2fa44..62a551dd 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/dist/platforms/ubuntu/steps/build.sh b/dist/platforms/ubuntu/steps/build.sh index 74388fc4..7bd719a2 100755 --- a/dist/platforms/ubuntu/steps/build.sh +++ b/dist/platforms/ubuntu/steps/build.sh @@ -119,7 +119,7 @@ echo "" unity-editor \ -logfile /dev/stdout \ - -quit \ + $( [ -n "${MANUAL_EXIT+set}" ] || echo "-quit" ) \ -customBuildName "$BUILD_NAME" \ -projectPath "$UNITY_PROJECT_PATH" \ -buildTarget "$BUILD_TARGET" \ diff --git a/src/model/build-parameters.ts b/src/model/build-parameters.ts index 4f430194..d3153fbb 100644 --- a/src/model/build-parameters.ts +++ b/src/model/build-parameters.ts @@ -29,6 +29,7 @@ class BuildParameters { public buildFile!: string; public buildMethod!: string; public buildVersion!: string; + public manualExit!: string | undefined; public androidVersionCode!: string; public androidKeystoreName!: string; public androidKeystoreBase64!: string; @@ -139,6 +140,7 @@ class BuildParameters { buildFile, buildMethod: Input.buildMethod, buildVersion, + manualExit: Input.manualExit, androidVersionCode, androidKeystoreName: Input.androidKeystoreName, androidKeystoreBase64: Input.androidKeystoreBase64, diff --git a/src/model/image-environment-factory.ts b/src/model/image-environment-factory.ts index ed780e48..c66697b4 100644 --- a/src/model/image-environment-factory.ts +++ b/src/model/image-environment-factory.ts @@ -37,6 +37,7 @@ class ImageEnvironmentFactory { { name: 'BUILD_PATH', value: parameters.buildPath }, { name: 'BUILD_FILE', value: parameters.buildFile }, { name: 'BUILD_METHOD', value: parameters.buildMethod }, + { name: 'MANUAL_EXIT', value: parameters.manualExit }, { name: 'VERSION', value: parameters.buildVersion }, { name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode }, { name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName }, diff --git a/src/model/input.test.ts b/src/model/input.test.ts index f5d08d5c..992059e7 100644 --- a/src/model/input.test.ts +++ b/src/model/input.test.ts @@ -104,6 +104,19 @@ describe('Input', () => { }); }); + describe('manualExit', () => { + it('returns the default value', () => { + expect(Input.manualExit).toStrictEqual(undefined); + }); + + it('takes input from the users workflow', () => { + const mockValue = 'x'; + const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue); + expect(Input.manualExit).toStrictEqual(mockValue); + expect(spy).toHaveBeenCalledTimes(1); + }); + }); + describe('versioningStrategy', () => { it('returns the default value', () => { expect(Input.versioningStrategy).toStrictEqual('Semantic'); diff --git a/src/model/input.ts b/src/model/input.ts index 011ed026..378ea1a3 100644 --- a/src/model/input.ts +++ b/src/model/input.ts @@ -126,6 +126,10 @@ class Input { return Input.getInput('buildMethod') || ''; // Processed in docker file } + static get manualExit(): string | undefined { + return Input.getInput('manualExit'); + } + static get customParameters(): string { return Input.getInput('customParameters') || ''; }