diff --git a/dist/index.js b/dist/index.js index ffc84538..2b01188d 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 e94fb95e..7185c6f7 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/cloud-runner/options/cloud-runner-options.ts b/src/model/cloud-runner/options/cloud-runner-options.ts index 830deb68..814d104c 100644 --- a/src/model/cloud-runner/options/cloud-runner-options.ts +++ b/src/model/cloud-runner/options/cloud-runner-options.ts @@ -103,14 +103,14 @@ class CloudRunnerOptions { static get buildPlatform(): string { const input = CloudRunnerOptions.getInput('buildPlatform'); - if (input) { + if (input && input !== '') { return input; } if (CloudRunnerOptions.providerStrategy !== 'local') { return 'linux'; } - return ``; + return process.platform; } static get cloudRunnerBranch(): string { diff --git a/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts b/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts index a649160d..eb028c46 100644 --- a/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts +++ b/src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts @@ -19,23 +19,28 @@ async function CreateParameters(overrides: any) { describe('Cloud Runner Kubernetes', () => { it('Responds', () => {}); setups(); + if (CloudRunnerOptions.cloudRunnerDebug) { it('Run one build it using K8s without error', async () => { if (CloudRunnerOptions.providerStrategy !== `k8s`) { return; } + process.env.USE_IL2CPP = 'false'; const overrides = { versioning: 'None', projectPath: 'test-project', unityVersion: UnityVersioning.determineUnityVersion('test-project', UnityVersioning.read('test-project')), targetPlatform: 'StandaloneLinux64', cacheKey: `test-case-${uuidv4()}`, + providerStrategy: 'k8s', + buildPlatform: 'linux', }; const buildParameter = await CreateParameters(overrides); expect(buildParameter.projectPath).toEqual(overrides.projectPath); const baseImage = new ImageTag(buildParameter); - const results = await CloudRunner.run(buildParameter, baseImage.toString()); + const resultsObject = await CloudRunner.run(buildParameter, baseImage.toString()); + const results = resultsObject.BuildResults; const libraryString = 'Rebuilding Library because the asset database could not be found!'; const cachePushFail = 'Did not push source folder to cache because it was empty Library'; const buildSucceededString = 'Build succeeded'; diff --git a/src/model/image-tag.ts b/src/model/image-tag.ts index cf484708..81145b6e 100644 --- a/src/model/image-tag.ts +++ b/src/model/image-tag.ts @@ -2,7 +2,6 @@ import Platform from './platform'; class ImageTag { public repository: string; - public cloudRunnerBuilderPlatform!: string; public editorVersion: string; public targetPlatform: string; public builderPlatform: string; @@ -15,7 +14,7 @@ class ImageTag { editorVersion, targetPlatform, customImage, - cloudRunnerBuilderPlatform, + buildPlatform, containerRegistryRepository, containerRegistryImageVersion, } = imageProperties; @@ -32,12 +31,8 @@ class ImageTag { this.repository = containerRegistryRepository; this.editorVersion = editorVersion; this.targetPlatform = targetPlatform; - this.cloudRunnerBuilderPlatform = cloudRunnerBuilderPlatform; - const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined; this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion); - this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes( - isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform, - ); + this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform); this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version. } @@ -63,6 +58,10 @@ class ImageTag { } static getImagePlatformPrefixes(platform: string): string { + if (!platform || platform === '') { + platform = process.platform; + } + switch (platform) { case 'win32': return 'windows'; @@ -101,7 +100,7 @@ class ImageTag { return windows; case Platform.types.StandaloneLinux64: { // Unity versions before 2019.3 do not support il2cpp - if (major >= 2020 || (major === 2019 && minor >= 3)) { + if (process.env.USE_IL2CPP === 'true' && (major >= 2020 || (major === 2019 && minor >= 3))) { return linuxIl2cpp; }