Add debug statement. TODO: Remove these
parent
9b1ea18e4a
commit
451c322d5b
|
|
@ -358,9 +358,9 @@ class Docker {
|
||||||
const { path, dockerfile, baseImage } = buildParameters;
|
const { path, dockerfile, baseImage } = buildParameters;
|
||||||
const { version, platform } = baseImage;
|
const { version, platform } = baseImage;
|
||||||
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
|
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
|
||||||
const command = `docker build ${path} \
|
const command = `docker build ${path} \
|
||||||
--file ${dockerfile} \
|
--file ${dockerfile} \
|
||||||
--build-arg IMAGE=${baseImage} \
|
--build-arg IMAGE=${baseImage} \
|
||||||
--tag ${tag}`;
|
--tag ${tag}`;
|
||||||
yield exec_1.exec(command, undefined, { silent });
|
yield exec_1.exec(command, undefined, { silent });
|
||||||
return tag;
|
return tag;
|
||||||
|
|
@ -371,56 +371,56 @@ class Docker {
|
||||||
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 { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, androidTargetSdkVersion, androidSdkManagerParameters, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters;
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'linux': {
|
case 'linux': {
|
||||||
const linuxRunCommand = `docker run \
|
const linuxRunCommand = `docker run \
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
--env UNITY_LICENSE \
|
--env UNITY_LICENSE \
|
||||||
--env UNITY_LICENSE_FILE \
|
--env UNITY_LICENSE_FILE \
|
||||||
--env UNITY_EMAIL \
|
--env UNITY_EMAIL \
|
||||||
--env UNITY_PASSWORD \
|
--env UNITY_PASSWORD \
|
||||||
--env UNITY_SERIAL \
|
--env UNITY_SERIAL \
|
||||||
--env UNITY_VERSION="${version}" \
|
--env UNITY_VERSION="${version}" \
|
||||||
--env USYM_UPLOAD_AUTH_TOKEN \
|
--env USYM_UPLOAD_AUTH_TOKEN \
|
||||||
--env PROJECT_PATH="${projectPath}" \
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
--env BUILD_TARGET="${platform}" \
|
--env BUILD_TARGET="${platform}" \
|
||||||
--env BUILD_NAME="${buildName}" \
|
--env BUILD_NAME="${buildName}" \
|
||||||
--env BUILD_PATH="${buildPath}" \
|
--env BUILD_PATH="${buildPath}" \
|
||||||
--env BUILD_FILE="${buildFile}" \
|
--env BUILD_FILE="${buildFile}" \
|
||||||
--env BUILD_METHOD="${buildMethod}" \
|
--env BUILD_METHOD="${buildMethod}" \
|
||||||
--env VERSION="${buildVersion}" \
|
--env VERSION="${buildVersion}" \
|
||||||
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
||||||
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
||||||
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
||||||
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
||||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||||
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
||||||
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
--env GITHUB_REF \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_REPOSITORY \
|
||||||
--env GITHUB_ACTOR \
|
--env GITHUB_ACTOR \
|
||||||
--env GITHUB_WORKFLOW \
|
--env GITHUB_WORKFLOW \
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_WORKSPACE=/github/workspace \
|
--env GITHUB_WORKSPACE=/github/workspace \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_ACTION \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_OS \
|
--env RUNNER_OS \
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
||||||
--volume "${runnerTempPath}/_github_home":"/root" \
|
--volume "${runnerTempPath}/_github_home":"/root" \
|
||||||
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
||||||
--volume "${workspace}":"/github/workspace" \
|
--volume "${workspace}":"/github/workspace" \
|
||||||
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
||||||
${image}`;
|
${image}`;
|
||||||
yield exec_1.exec(linuxRunCommand, undefined, { silent });
|
yield exec_1.exec(linuxRunCommand, undefined, { silent });
|
||||||
break;
|
break;
|
||||||
|
|
@ -430,9 +430,9 @@ class Docker {
|
||||||
if (!process.env.UNITY_SERIAL) {
|
if (!process.env.UNITY_SERIAL) {
|
||||||
//No serial was present so it is a personal license that we need to convert
|
//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
|
throw new Error(`Missing Unity License File and no Serial was found. If this
|
||||||
is a personal license, make sure to follow the activation
|
is a personal license, make sure to follow the activation
|
||||||
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
|
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);
|
unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE);
|
||||||
|
|
@ -441,60 +441,61 @@ class Docker {
|
||||||
unitySerial = process.env.UNITY_SERIAL;
|
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 to
|
throw new Error(`Unity email and password must be set for Windows based builds to
|
||||||
authenticate the license. Make sure to set them inside UNITY_EMAIL
|
authenticate the license. Make sure to set them inside UNITY_EMAIL
|
||||||
and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);
|
and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);
|
||||||
}
|
}
|
||||||
yield this.setupWindowsRun(platform);
|
yield this.setupWindowsRun(platform);
|
||||||
this.validateWindowsPlatformRequirements(platform);
|
this.validateWindowsPlatformRequirements(platform);
|
||||||
const windowsRunCommand = `docker run \
|
console.log("Len: " + process.env.UNITY_EMAIL.length);
|
||||||
--workdir c:/github/workspace \
|
const windowsRunCommand = `docker run \
|
||||||
--rm \
|
--workdir c:/github/workspace \
|
||||||
--env UNITY_LICENSE \
|
--rm \
|
||||||
--env UNITY_LICENSE_FILE \
|
--env UNITY_LICENSE \
|
||||||
--env UNITY_EMAIL \
|
--env UNITY_LICENSE_FILE \
|
||||||
--env UNITY_PASSWORD \
|
--env UNITY_EMAIL \
|
||||||
--env UNITY_SERIAL="${unitySerial}" \
|
--env UNITY_PASSWORD \
|
||||||
--env UNITY_VERSION="${version}" \
|
--env UNITY_SERIAL="${unitySerial}" \
|
||||||
--env USYM_UPLOAD_AUTH_TOKEN \
|
--env UNITY_VERSION="${version}" \
|
||||||
--env PROJECT_PATH="${projectPath}" \
|
--env USYM_UPLOAD_AUTH_TOKEN \
|
||||||
--env BUILD_TARGET="${platform}" \
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
--env BUILD_NAME="${buildName}" \
|
--env BUILD_TARGET="${platform}" \
|
||||||
--env BUILD_PATH="${buildPath}" \
|
--env BUILD_NAME="${buildName}" \
|
||||||
--env BUILD_FILE="${buildFile}" \
|
--env BUILD_PATH="${buildPath}" \
|
||||||
--env BUILD_METHOD="${buildMethod}" \
|
--env BUILD_FILE="${buildFile}" \
|
||||||
--env VERSION="${buildVersion}" \
|
--env BUILD_METHOD="${buildMethod}" \
|
||||||
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
--env VERSION="${buildVersion}" \
|
||||||
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
||||||
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
||||||
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
||||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
||||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||||
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||||
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
||||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
--env GITHUB_REF \
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_ACTOR \
|
--env GITHUB_REPOSITORY \
|
||||||
--env GITHUB_WORKFLOW \
|
--env GITHUB_ACTOR \
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_WORKFLOW \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_WORKSPACE=/github/workspace \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_WORKSPACE=/github/workspace \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_ACTION \
|
||||||
--env RUNNER_OS \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_OS \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_TEMP \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env RUNNER_WORKSPACE \
|
||||||
--volume "${workspace}":"c:/github/workspace" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
--volume "c:/regkeys":"c:/regkeys" \
|
--volume "${workspace}":"c:/github/workspace" \
|
||||||
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
--volume "c:/regkeys":"c:/regkeys" \
|
||||||
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
||||||
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
||||||
|
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
||||||
${image}`;
|
${image}`;
|
||||||
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
//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 });
|
yield exec_1.exec(windowsRunCommand, undefined, { silent });
|
||||||
|
|
@ -553,8 +554,8 @@ class Docker {
|
||||||
static checkForWin10SDK() {
|
static checkForWin10SDK() {
|
||||||
//Check for Windows 10 SDK on runner
|
//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
|
throw new Error(`Windows 10 SDK not found in default location. Make sure
|
||||||
the runner has a Windows 10 SDK installed in the default
|
the runner has a Windows 10 SDK installed in the default
|
||||||
location.`);
|
location.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -562,8 +563,8 @@ class Docker {
|
||||||
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
//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') &&
|
if (!(fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
|
||||||
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
|
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
|
||||||
throw new Error(`Visual Studio not found at the default location.
|
throw new Error(`Visual Studio not found at the default location.
|
||||||
Make sure the runner has Visual Studio installed in the
|
Make sure the runner has Visual Studio installed in the
|
||||||
default location`);
|
default location`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,5 @@
|
||||||
# Activates Unity
|
# Activates Unity
|
||||||
|
Write-Output $Env:UNITY_USER
|
||||||
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
|
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
|
||||||
-username $Env:UNITY_USER `
|
-username $Env:UNITY_USER `
|
||||||
-password $Env:UNITY_PASS `
|
-password $Env:UNITY_PASS `
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue