Add additional build targets (uwp and tvOS)

Adjustments to build scripts to not require win10 sdk when not needed (tvOS)
Platform-based prereq setup
Setup image tags for the new platforms with errors if building on the wrong base os
Rename test-project-il2cpp to test-project-windows to be used for all windows based project building (IL2CPP backend selected instead of mono)
Fix tests to be platform based
pull/305/head
Andrew Kahr 2021-12-26 14:05:08 -08:00
parent 9228ae394f
commit 52bb48dd5c
36 changed files with 488 additions and 207 deletions

View File

@ -79,11 +79,13 @@ jobs:
fail-fast: false
matrix:
projectPath:
- test-project-il2cpp
- test-project-windows
unityVersion:
- 2020.3.24f1
targetPlatform:
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- WSAPlayer # Build a UWP App
- tvOS # Build an Apple TV XCode project
steps:
###########################

220
dist/index.js vendored
View File

@ -88,7 +88,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const path_1 = __importDefault(__webpack_require__(85622));
class Action {
static get supportedPlatforms() {
return ['linux'];
return ['linux', 'win32'];
}
static get isRunningLocally() {
return process.env.RUNNER_WORKSPACE === undefined;
@ -109,7 +109,15 @@ class Action {
return `${Action.rootFolder}/dist`;
}
static get dockerfile() {
return `${Action.actionFolder}/Dockerfile`;
const currentPlatform = process.platform;
switch (currentPlatform) {
case "linux":
return `${Action.actionFolder}/platforms/ubuntu/Dockerfile`;
case "win32":
return `${Action.actionFolder}/platforms/windows/Dockerfile`;
default:
throw new Error(`No Dockerfile for currently unsupported platform: ${currentPlatform}`);
}
}
static get workspace() {
return process.env.GITHUB_WORKSPACE;
@ -343,6 +351,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
const exec_1 = __webpack_require__(71514);
const image_tag_1 = __importDefault(__webpack_require__(57648));
const fs = __webpack_require__(35747);
class Docker {
static build(buildParameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
@ -360,7 +369,9 @@ class Docker {
static run(image, parameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, androidTargetSdkVersion, androidSdkManagerParameters, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters;
const command = `docker run \
switch (process.platform) {
case 'linux': {
const linuxRunCommand = `docker run \
--workdir /github/workspace \
--rm \
--env UNITY_LICENSE \
@ -411,9 +422,163 @@ class Docker {
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
${image}`;
yield exec_1.exec(command, undefined, { silent });
yield exec_1.exec(linuxRunCommand, undefined, { silent });
break;
}
case 'win32': {
let unitySerial = '';
if (!process.env.UNITY_SERIAL) {
//No serial was present so it is a personal license that we need to convert
if (!process.env.UNITY_LICENSE) {
throw new Error(`Missing Unity License File and no Serial was found. If this
is a personal license, make sure to follow the activation
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
serial number inside the UNITY_SERIAL GitHub secret.`);
}
unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE);
}
else {
unitySerial = process.env.UNITY_SERIAL;
}
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {
throw new Error(`Unity email and password must be set for windows based builds`);
}
yield this.setupWindowsRun(platform);
this.validateWindowsPrereqs(platform);
const windowsRunCommand = `docker run \
--workdir c:/github/workspace \
--rm \
--env UNITY_LICENSE \
--env UNITY_LICENSE_FILE \
--env UNITY_EMAIL \
--env UNITY_PASSWORD \
--env UNITY_SERIAL="${unitySerial}" \
--env UNITY_VERSION="${version}" \
--env USYM_UPLOAD_AUTH_TOKEN \
--env PROJECT_PATH="${projectPath}" \
--env BUILD_TARGET="${platform}" \
--env BUILD_NAME="${buildName}" \
--env BUILD_PATH="${buildPath}" \
--env BUILD_FILE="${buildFile}" \
--env BUILD_METHOD="${buildMethod}" \
--env VERSION="${buildVersion}" \
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
--env CUSTOM_PARAMETERS="${customParameters}" \
--env CHOWN_FILES_TO="${chownFilesTo}" \
--env GITHUB_REF \
--env GITHUB_SHA \
--env GITHUB_REPOSITORY \
--env GITHUB_ACTOR \
--env GITHUB_WORKFLOW \
--env GITHUB_HEAD_REF \
--env GITHUB_BASE_REF \
--env GITHUB_EVENT_NAME \
--env GITHUB_WORKSPACE=/github/workspace \
--env GITHUB_ACTION \
--env GITHUB_EVENT_PATH \
--env RUNNER_OS \
--env RUNNER_TOOL_CACHE \
--env RUNNER_TEMP \
--env RUNNER_WORKSPACE \
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
--volume "${runnerTempPath}/_github_home":"c:/root" \
--volume "${runnerTempPath}/_github_workflow":"c:/github/workflow" \
--volume "${workspace}":"c:/github/workspace" \
--volume "c:/regkeys":"c:/regkeys" \
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
${image}`;
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
yield exec_1.exec(windowsRunCommand, undefined, { silent });
break;
}
default:
throw new Error(`Can't run docker on unsupported host platform`);
}
});
}
//Setup prerequisite files/folders for a windows-based docker run
static setupWindowsRun(platform, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const makeRegKeyFolderCommand = 'mkdir c:/regkeys';
yield exec_1.exec(makeRegKeyFolderCommand, undefined, { silent });
switch (platform) {
//These all need the Windows 10 SDK
case 'StandaloneWindows':
this.generateWinSDKRegKeys(silent);
break;
case 'StandaloneWindows64':
this.generateWinSDKRegKeys(silent);
break;
case 'WSAPlayer':
this.generateWinSDKRegKeys(silent);
break;
}
});
}
static generateWinSDKRegKeys(silent = false) {
return __awaiter(this, void 0, void 0, function* () {
//Export registry keys that point to the location of the windows 10 sdk
const exportWinSDKRegKeysCommand = 'echo Y| reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" c:/regkeys/winsdk.reg';
yield exec_1.exec(exportWinSDKRegKeysCommand, undefined, { silent });
});
}
static validateWindowsPrereqs(platform) {
//We run different checks for different platforms
switch (platform) {
case 'StandaloneWindows':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'StandaloneWindows64':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'WSAPlayer':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'tvOS':
this.checkForVisualStudio();
break;
}
}
static checkForWin10SDK() {
//Check for Windows 10 SDK on runner
if (!fs.existsSync('C:/Program Files (x86)/Windows Kits')) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
the runner has a Windows 10 SDK installed in the default
location.`);
}
}
static checkForVisualStudio() {
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
if (!(fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
throw new Error(`Visual Studio Installation not found at default location.
Make sure the runner has Visual Studio installed in the
default location`);
}
}
static getSerialFromLicenseFile(license) {
const startKey = `<DeveloperData Value="`;
const endKey = `"/>`;
const startIndex = license.indexOf(startKey) + startKey.length;
if (startIndex < 0) {
throw new Error(`License File was corrupted, unable to locate serial`);
}
const endIndex = license.indexOf(endKey, startIndex);
//We slice off the first 4 characters as they are garbage values
return Buffer.from(license.slice(startIndex, endIndex), 'base64').toString('binary').slice(4);
}
}
exports.default = Docker;
@ -487,23 +652,48 @@ class ImageTag {
webgl: 'webgl',
mac: 'mac-mono',
windows: 'windows-mono',
windowsIl2cpp: 'windows-il2cpp',
wsaplayer: 'universal-windows-platform',
linux: 'base',
linuxIl2cpp: 'linux-il2cpp',
android: 'android',
ios: 'ios',
tvos: 'appletv',
facebook: 'facebook',
};
}
static getTargetPlatformToImageSuffixMap(platform, version) {
const { generic, webgl, mac, windows, linux, linuxIl2cpp, android, ios, facebook } = ImageTag.imageSuffixes;
const { generic, webgl, mac, windows, windowsIl2cpp, wsaplayer, linux, linuxIl2cpp, android, ios, tvos, facebook, } = ImageTag.imageSuffixes;
const [major, minor] = version.split('.').map((digit) => Number(digit));
// @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html
switch (platform) {
case platform_1.default.types.StandaloneOSX:
return mac;
case platform_1.default.types.StandaloneWindows:
// Can only build windows-il2cpp on a windows based system
if (process.platform === 'win32') {
// Unity versions before 2019.3 do not support il2cpp
if (major >= 2020 || (major === 2019 && minor >= 3)) {
return windowsIl2cpp;
}
else {
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
If you are trying to build for windows-mono, please use a Linux based OS.`);
}
}
return windows;
case platform_1.default.types.StandaloneWindows64:
// Can only build windows-il2cpp on a windows based system
if (process.platform === 'win32') {
// Unity versions before 2019.3 do not support il2cpp
if (major >= 2020 || (major === 2019 && minor >= 3)) {
return windowsIl2cpp;
}
else {
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
If you are trying to build for windows-mono, please use a Linux based OS.`);
}
}
return windows;
case platform_1.default.types.StandaloneLinux64: {
// Unity versions before 2019.3 do not support il2cpp
@ -519,13 +709,19 @@ class ImageTag {
case platform_1.default.types.WebGL:
return webgl;
case platform_1.default.types.WSAPlayer:
return windows;
if (process.platform !== 'win32') {
throw new Error(`WSAPlayer can only be built on a windows base OS`);
}
return wsaplayer;
case platform_1.default.types.PS4:
return windows;
case platform_1.default.types.XboxOne:
return windows;
case platform_1.default.types.tvOS:
return windows;
if (process.platform !== 'win32') {
throw new Error(`tvOS can only be built on a windows base OS`);
}
return tvos;
case platform_1.default.types.Switch:
return windows;
// Unsupported
@ -549,7 +745,15 @@ class ImageTag {
}
}
get tag() {
return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
//We check the host os so we know what type of the images we need to pull
switch (process.platform) {
case 'win32':
return `windows-${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
case 'linux':
return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
default:
break;
}
}
get image() {
return `${this.repository}/${this.name}`.replace(/^\/+/, '');

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,9 @@
# First we activate Unity
& "c:\steps\activate.ps1"
# Next we import the registry keys that point Unity to the win 10 sdk
reg import c:\regkeys\winsdk.reg
# Next we import any necessary registry keys, ie: location of windows 10 sdk
# No guarantee that there will be any necessary registry keys, ie: tvOS
Get-ChildItem -Path c:\regkeys -File | Foreach {reg import $_.fullname}
# Now we register the visual studio installation so Unity can find it
regsvr32 C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll

View File

@ -1,5 +1,4 @@
import { exec } from '@actions/exec';
import { fstat } from 'fs';
import ImageTag from './image-tag';
const fs = require('fs');
@ -45,9 +44,8 @@ class Docker {
chownFilesTo,
} = parameters;
switch(process.platform)
{
case "linux":
switch (process.platform) {
case 'linux': {
const linuxRunCommand = `docker run \
--workdir /github/workspace \
--rm \
@ -102,32 +100,29 @@ class Docker {
await exec(linuxRunCommand, undefined, { silent });
break;
case "win32":
var unitySerial = "";
if (!process.env.UNITY_SERIAL)
{
}
case 'win32': {
let unitySerial = '';
if (!process.env.UNITY_SERIAL) {
//No serial was present so it is a personal license that we need to convert
if (!process.env.UNITY_LICENSE)
{
if (!process.env.UNITY_LICENSE) {
throw new Error(`Missing Unity License File and no Serial was found. If this
is a personal license, make sure to follow the activation
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
serial number inside the UNITY_SERIAL GitHub secret.`)
serial number inside the UNITY_SERIAL GitHub secret.`);
}
unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE);
} else
{
} else {
unitySerial = process.env.UNITY_SERIAL!;
}
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD))
{
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {
throw new Error(`Unity email and password must be set for windows based builds`);
}
await this.setupWindowsRun();
await this.setupWindowsRun(platform);
this.validateWindowsPrereqs();
this.validateWindowsPrereqs(platform);
const windowsRunCommand = `docker run \
--workdir c:/github/workspace \
@ -180,53 +175,95 @@ class Docker {
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
${image}`;
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
await exec(windowsRunCommand, undefined, { silent });
break;
}
default:
throw new Error(`Can't run docker on unsupported host platform`);
}
}
//Setup prerequisite files for a windows-based docker run
static async setupWindowsRun(silent = false) {
//Need to export registry keys that point to the location of the windows 10 sdk
const makeRegKeyFolderCommand = "mkdir c:/regkeys";
await exec(makeRegKeyFolderCommand, undefined, {silent});
const exportRegKeysCommand = "echo Y| reg export \"HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0\" c:/regkeys/winsdk.reg";
await exec(exportRegKeysCommand, undefined, {silent});
//Setup prerequisite files/folders for a windows-based docker run
static async setupWindowsRun(platform, silent = false) {
const makeRegKeyFolderCommand = 'mkdir c:/regkeys';
await exec(makeRegKeyFolderCommand, undefined, { silent });
switch (platform) {
//These all need the Windows 10 SDK
case 'StandaloneWindows':
this.generateWinSDKRegKeys(silent);
break;
case 'StandaloneWindows64':
this.generateWinSDKRegKeys(silent);
break;
case 'WSAPlayer':
this.generateWinSDKRegKeys(silent);
break;
}
}
static validateWindowsPrereqs() {
//Check for Visual Studio on runner
if (!(fs.existsSync("C:/Program Files (x86)/Microsoft Visual Studio") && fs.existsSync("C:/ProgramData/Microsoft/VisualStudio")))
{
throw new Error(`Visual Studio Installation not found at default location.
Make sure the runner has Visual Studio installed in the
default location`);
}
static async generateWinSDKRegKeys(silent = false) {
//Export registry keys that point to the location of the windows 10 sdk
const exportWinSDKRegKeysCommand =
'echo Y| reg export "HKLM\\SOFTWARE\\WOW6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0" c:/regkeys/winsdk.reg';
await exec(exportWinSDKRegKeysCommand, undefined, { silent });
}
static validateWindowsPrereqs(platform) {
//We run different checks for different platforms
switch (platform) {
case 'StandaloneWindows':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'StandaloneWindows64':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'WSAPlayer':
this.checkForVisualStudio();
this.checkForWin10SDK();
break;
case 'tvOS':
this.checkForVisualStudio();
break;
}
}
static checkForWin10SDK() {
//Check for Windows 10 SDK on runner
if(!fs.existsSync("C:/Program Files (x86)/Windows Kits"))
{
if (!fs.existsSync('C:/Program Files (x86)/Windows Kits')) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
the runner has a Windows 10 SDK installed in the default
location.`);
the runner has a Windows 10 SDK installed in the default
location.`);
}
}
static getSerialFromLicenseFile(license)
{
static checkForVisualStudio() {
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
if (
!(
fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio')
)
) {
throw new Error(`Visual Studio Installation not found at default location.
Make sure the runner has Visual Studio installed in the
default location`);
}
}
static getSerialFromLicenseFile(license) {
const startKey = `<DeveloperData Value="`;
const endKey = `"/>`;
let startIndex = license.indexOf(startKey) + startKey.length;
if (startIndex < 0)
{
const startIndex = license.indexOf(startKey) + startKey.length;
if (startIndex < 0) {
throw new Error(`License File was corrupted, unable to locate serial`);
}
let endIndex = license.indexOf(endKey, startIndex);
//We substring off the first character as it is a garbage value
return atob(license.substring(startIndex, endIndex)).substring(1);
const endIndex = license.indexOf(endKey, startIndex);
//We slice off the first 4 characters as they are garbage values
return Buffer.from(license.slice(startIndex, endIndex), 'base64').toString('binary').slice(4);
}
}

View File

@ -48,8 +48,14 @@ describe('ImageTag', () => {
describe('toString', () => {
it('returns the correct version', () => {
const image = new ImageTag({ version: '2099.1.1111', platform: some.platform });
expect(image.toString()).toStrictEqual(`${defaults.image}:2099.1.1111-0`);
switch (process.platform) {
case 'win32':
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2099.1.1111-0`);
break;
case 'linux':
expect(image.toString()).toStrictEqual(`${defaults.image}:2099.1.1111-0`);
break;
}
});
it('returns customImage if given', () => {
const image = new ImageTag({
@ -64,13 +70,27 @@ describe('ImageTag', () => {
it('returns the specific build platform', () => {
const image = new ImageTag({ version: '2019.2.11f1', platform: 'WebGL' });
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-webgl-0`);
switch (process.platform) {
case 'win32':
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-webgl-0`);
break;
case 'linux':
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-webgl-0`);
break;
}
});
it('returns no specific build platform for generic targetPlatforms', () => {
const image = new ImageTag({ platform: 'NoTarget' });
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-0`);
switch (process.platform) {
case 'win32':
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-0`);
break;
case 'linux':
expect(image.toString()).toStrictEqual(`${defaults.image}:2019.2.11f1-0`);
break;
}
});
});
});

View File

@ -36,16 +36,31 @@ class ImageTag {
mac: 'mac-mono',
windows: 'windows-mono',
windowsIl2cpp: 'windows-il2cpp',
wsaplayer: 'universal-windows-platform',
linux: 'base',
linuxIl2cpp: 'linux-il2cpp',
android: 'android',
ios: 'ios',
tvos: 'appletv',
facebook: 'facebook',
};
}
static getTargetPlatformToImageSuffixMap(platform, version) {
const { generic, webgl, mac, windows, windowsIl2cpp, linux, linuxIl2cpp, android, ios, facebook } = ImageTag.imageSuffixes;
const {
generic,
webgl,
mac,
windows,
windowsIl2cpp,
wsaplayer,
linux,
linuxIl2cpp,
android,
ios,
tvos,
facebook,
} = ImageTag.imageSuffixes;
const [major, minor] = version.split('.').map((digit) => Number(digit));
// @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html
@ -53,30 +68,26 @@ class ImageTag {
case Platform.types.StandaloneOSX:
return mac;
case Platform.types.StandaloneWindows:
// Unity versions before 2019.3 do not support il2cpp
// Can only build windows-il2cpp on a windows based system
if (process.platform == "win32")
{
if (process.platform === 'win32') {
// Unity versions before 2019.3 do not support il2cpp
if (major >= 2020 || (major === 2019 && minor >= 3)) {
return windowsIl2cpp;
} else
{
} else {
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
If you are trying to build for windows-mono, please use a Linux based OS.`)
If you are trying to build for windows-mono, please use a Linux based OS.`);
}
}
return windows;
case Platform.types.StandaloneWindows64:
// Unity versions before 2019.3 do not support il2cpp
// Can only build windows-il2cpp on a windows based system
if (process.platform == "win32")
{
if (process.platform === 'win32') {
// Unity versions before 2019.3 do not support il2cpp
if (major >= 2020 || (major === 2019 && minor >= 3)) {
return windowsIl2cpp;
} else
{
} else {
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
If you are trying to build for windows-mono, please use a Linux based OS.`)
If you are trying to build for windows-mono, please use a Linux based OS.`);
}
}
return windows;
@ -94,13 +105,19 @@ class ImageTag {
case Platform.types.WebGL:
return webgl;
case Platform.types.WSAPlayer:
return windows;
if (process.platform !== 'win32') {
throw new Error(`WSAPlayer can only be built on a windows base OS`);
}
return wsaplayer;
case Platform.types.PS4:
return windows;
case Platform.types.XboxOne:
return windows;
case Platform.types.tvOS:
return windows;
if (process.platform !== 'win32') {
throw new Error(`tvOS can only be built on a windows base OS`);
}
return tvos;
case Platform.types.Switch:
return windows;
// Unsupported
@ -126,14 +143,14 @@ class ImageTag {
}
get tag() {
if (ImageTag.getTargetPlatformToImageSuffixMap(this.platform, this.version) === ImageTag.imageSuffixes.windowsIl2cpp)
{
//Windows based image tags are prefixed with windows-
return `windows-${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
}
else
{
return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
//We check the host os so we know what type of the images we need to pull
switch (process.platform) {
case 'win32':
return `windows-${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
case 'linux':
return `${this.version}-${this.builderPlatform}`.replace(/-+$/, '');
default:
break;
}
}