Sync docs2 (#341)

* Run build

* Sync docs
pull/335/head^2
David Finol 2022-02-21 13:19:28 -06:00 committed by GitHub
parent a6ebcb5b75
commit b94200d3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 269 additions and 219 deletions

View File

@ -2,6 +2,10 @@ name: 'Unity - Builder'
author: Webber Takken <webber@takken.io>
description: 'Build Unity projects for different platforms.'
inputs:
targetPlatform:
required: true
default: ''
description: 'Platform that the build should target.'
unityVersion:
required: false
default: 'auto'
@ -10,10 +14,6 @@ inputs:
required: false
default: ''
description: 'Specific docker image that should be used for building the project'
targetPlatform:
required: false
default: ''
description: 'Platform that the build should target.'
projectPath:
required: false
default: ''
@ -22,18 +22,6 @@ inputs:
required: false
default: ''
description: 'Name of the build.'
postBuildSteps:
required: false
default: ''
description: 'run a post build job in yaml format with the keys image, secrets (name, value object array), command string'
preBuildSteps:
required: false
default: ''
description: 'Run a pre build job after the repository setup but before the build job (in yaml format with the keys image, secrets (name, value object array), command line string)'
customJob:
required: false
default: ''
description: 'Run a custom job instead of the standard build automation for cloud runner (in yaml format with the keys image, secrets (name, value object array), command line string)'
buildsPath:
required: false
default: ''
@ -42,38 +30,10 @@ inputs:
required: false
default: ''
description: 'Path to a Namespace.Class.StaticMethod to run to perform the build.'
cloudRunnerCluster:
default: 'local'
customParameters:
required: false
description: 'Either local, k8s or aws can be used to run builds on a remote cluster. Additional parameters must be configured.'
awsStackName:
default: 'game-ci'
required: false
description: 'The Cloud Formation stack name that must be setup before using this option.'
kubeConfig:
default: ''
required: false
description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.'
kubeVolume:
default: ''
required: false
description: 'Supply a Persistent Volume Claim name to use for the Unity build.'
cloudRunnerMemory:
default: '750M'
required: false
description: 'Amount of memory to assign the remote build container'
cloudRunnerCpu:
default: '1.0'
required: false
description: 'Amount of CPU time to assign the remote build container'
kubeVolumeSize:
default: '5Gi'
required: false
description: 'Amount of disc space to assign the Kubernetes Persistent Volume'
githubToken:
default: ''
required: false
description: 'GitHub token for cloning, only needed when kubeconfig is used.'
description: 'Custom parameters to configure the build.'
versioning:
required: false
default: 'Semantic'
@ -114,14 +74,6 @@ inputs:
required: false
default: ''
description: 'The android target API level.'
customParameters:
required: false
default: ''
description: >
Custom parameters to configure the build.
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
Parameters without a value will be considered booleans (with a value of true).
sshAgent:
required: false
default: ''
@ -129,8 +81,7 @@ inputs:
gitPrivateToken:
required: false
default: ''
description: >
Github private token to pull from github
description: 'Github private token to pull from github'
chownFilesTo:
required: false
default: ''
@ -138,12 +89,51 @@ inputs:
allowDirtyBuild:
required: false
default: ''
description: >
Allows the branch of the build to be dirty, and still generate the build.
Note that it is generally bad practice to modify your branch
in a CI Pipeline. However there are exceptions where this might
be needed. (use with care).
description: 'Allows the branch of the build to be dirty, and still generate the build.'
postBuildSteps:
required: false
default: ''
description: 'run a post build job in yaml format with the keys image, secrets (name, value object array), command string'
preBuildSteps:
required: false
default: ''
description: 'Run a pre build job after the repository setup but before the build job (in yaml format with the keys image, secrets (name, value object array), command line string)'
customJob:
required: false
default: ''
description: 'Run a custom job instead of the standard build automation for cloud runner (in yaml format with the keys image, secrets (name, value object array), command line string)'
awsBaseStackName:
default: 'game-ci'
required: false
description: 'The Cloud Formation stack name that must be setup before using this option.'
cloudRunnerCluster:
default: 'local'
required: false
description: 'Either local, k8s or aws can be used to run builds on a remote cluster. Additional parameters must be configured.'
cloudRunnerCpu:
default: '1.0'
required: false
description: 'Amount of CPU time to assign the remote build container'
cloudRunnerMemory:
default: '750M'
required: false
description: 'Amount of memory to assign the remote build container'
githubToken:
default: ''
required: false
description: 'GitHub token for cloning, only needed when kubeconfig is used.'
kubeConfig:
default: ''
required: false
description: 'Supply a base64 encoded kubernetes config to run builds on kubernetes and stream logs until completion.'
kubeVolume:
default: ''
required: false
description: 'Supply a Persistent Volume Claim name to use for the Unity build.'
kubeVolumeSize:
default: '5Gi'
required: false
description: 'Amount of disc space to assign the Kubernetes Persistent Volume'
outputs:
volume:
description: 'The Persistent Volume (PV) where the build artifacts have been stored by Kubernetes'

252
dist/index.js generated vendored
View File

@ -277,9 +277,9 @@ class BuildParameters {
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
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);
@ -402,10 +402,10 @@ class Cache {
if (action_1.default.isRunningLocally) {
return;
}
core.warning(`
Library folder does not exist.
Consider setting up caching to speed up your workflow,
if this is not your first build.
core.warning(`
Library folder does not exist.
Consider setting up caching to speed up your workflow,
if this is not your first build.
`);
}
}
@ -552,8 +552,8 @@ class CLI {
static runRemoteClientJob() {
return __awaiter(this, void 0, void 0, function* () {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
`);
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
@ -1554,25 +1554,25 @@ exports.AWSTemplates = void 0;
const fs = __importStar(__webpack_require__(35747));
class AWSTemplates {
static getParameterTemplate(p1) {
return `
${p1}:
Type: String
Default: ''
return `
${p1}:
Type: String
Default: ''
`;
}
static getSecretTemplate(p1) {
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: '${p1}'
SecretString: !Ref ${p1}
return `
${p1}Secret:
Type: AWS::SecretsManager::Secret
Properties:
Name: '${p1}'
SecretString: !Ref ${p1}
`;
}
static getSecretDefinitionTemplate(p1, p2) {
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
return `
- Name: '${p1}'
ValueFrom: !Ref ${p2}Secret
`;
}
static insertAtTemplate(template, insertionKey, insertion) {
@ -2194,8 +2194,8 @@ class KubernetesJobSpecFactory {
command: [
'bin/bash',
'-c',
`cd /data/builder/action/steps;
chmod +x /return_license.sh;
`cd /data/builder/action/steps;
chmod +x /return_license.sh;
/return_license.sh;`,
],
},
@ -2605,15 +2605,15 @@ const yaml_1 = __importDefault(__webpack_require__(13552));
class CloudRunnerBuildCommandProcessor {
static ProcessCommands(commands, buildParameters) {
const hooks = CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`all`));
return `echo "---"
echo "start cloud runner init"
${__1.Input.cloudRunnerTests ? '' : '#'} printenv
echo "start cloud runner job"
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${commands}
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
echo "end of cloud runner job
---${buildParameters.logId}"
return `echo "---"
echo "start cloud runner init"
${__1.Input.cloudRunnerTests ? '' : '#'} printenv
echo "start cloud runner job"
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
${commands}
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
echo "end of cloud runner job
---${buildParameters.logId}"
`;
}
static getHooks() {
@ -2949,37 +2949,37 @@ class BuildStep {
cloud_runner_logger_1.default.logLine(` `);
cloud_runner_logger_1.default.logLine('Starting part 2/2 (build unity project)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}"
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GITHUB_WORKSPACE="${cloud_runner_state_1.CloudRunnerState.repoPathFull}"
cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'default-build-script')
.replace(/\\/g, `/`)}" "/UnityBuilderAction"
.replace(/\\/g, `/`)}" "/UnityBuilderAction"
cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'platforms', 'ubuntu', 'entrypoint.sh')
.replace(/\\/g, `/`)}" "/entrypoint.sh"
.replace(/\\/g, `/`)}" "/entrypoint.sh"
cp -r "${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'platforms', 'ubuntu', 'steps')
.replace(/\\/g, `/`)}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
apt-get update
apt-get install -y -q zip tree
cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.."
zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library"
mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
.replace(/\\/g, `/`)}" "/steps"
chmod -R +x "/entrypoint.sh"
chmod -R +x "/steps"
/entrypoint.sh
apt-get update
apt-get install -y -q zip tree
cd "${cloud_runner_state_1.CloudRunnerState.libraryFolderFull.replace(/\\/g, `/`)}/.."
zip -r "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "Library"
mv "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
cd "${cloud_runner_state_1.CloudRunnerState.repoPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
zip -r "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "build"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
mv "build-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}"
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default
.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`)
.replace(/\\/g, `/`)} -m cache-push "Library" "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}"
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
.replace(/\\/g, `/`)} -m cache-push "Library" "lib-${cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid}.zip" "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull.replace(/\\/g, `/`)}/Library"
${__1.Input.cloudRunnerTests ? '' : '#'} tree -lh "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}"
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.projectPathFull}`, environmentVariables, secrets);
});
}
@ -3030,16 +3030,16 @@ class SetupStep {
cloud_runner_logger_1.default.log(` `);
cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)');
const hooks = cloud_runner_build_command_process_1.CloudRunnerBuildCommandProcessor.getHooks().filter((x) => x.step.includes(`setup`));
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `apk update -q
apk add git-lfs jq tree zip unzip nodejs -q
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `apk update -q
apk add git-lfs jq tree zip unzip nodejs -q
${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
git clone -q -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
}
catch (error) {
@ -3296,9 +3296,9 @@ class Docker {
const { path, dockerfile, baseImage } = buildParameters;
const { version, platform } = baseImage;
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
const command = `docker build ${path} \
--file ${dockerfile} \
--build-arg IMAGE=${baseImage} \
const command = `docker build ${path} \
--file ${dockerfile} \
--build-arg IMAGE=${baseImage} \
--tag ${tag}`;
yield exec_1.exec(command, undefined, { silent });
return tag;
@ -3308,11 +3308,11 @@ class Docker {
return __awaiter(this, void 0, void 0, function* () {
const { workspace, unitySerial, runnerTempPath, sshAgent } = parameters;
const baseOsSpecificArguments = this.getBaseOsSpecificArguments(process.platform, workspace, unitySerial, runnerTempPath, sshAgent);
const runCommand = `docker run \
--workdir /github/workspace \
--rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \
${baseOsSpecificArguments} \
const runCommand = `docker run \
--workdir /github/workspace \
--rm \
${image_environment_factory_1.default.getEnvVarString(parameters)} \
${baseOsSpecificArguments} \
${image}`;
yield exec_1.exec(runCommand, undefined, { silent });
});
@ -3320,22 +3320,22 @@ class Docker {
static getBaseOsSpecificArguments(baseOs, workspace, unitySerial, runnerTemporaryPath, sshAgent) {
switch (baseOs) {
case 'linux':
return `--env UNITY_SERIAL \
--env GITHUB_WORKSPACE=/github/workspace \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTemporaryPath}/_github_home":"/root" \
--volume "${runnerTemporaryPath}/_github_workflow":"/github/workflow" \
--volume "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
return `--env UNITY_SERIAL \
--env GITHUB_WORKSPACE=/github/workspace \
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
--volume "${runnerTemporaryPath}/_github_home":"/root" \
--volume "${runnerTemporaryPath}/_github_workflow":"/github/workflow" \
--volume "${workspace}":"/github/workspace" \
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''}`;
case 'win32':
return `--env UNITY_SERIAL="${unitySerial}" \
--env GITHUB_WORKSPACE=c:/github/workspace \
--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" \
return `--env UNITY_SERIAL="${unitySerial}" \
--env GITHUB_WORKSPACE=c:/github/workspace \
--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"`;
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
}
@ -3515,7 +3515,7 @@ class ImageTag {
return windowsIl2cpp;
}
else {
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
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.`);
}
}
@ -3564,8 +3564,8 @@ class ImageTag {
case platform_1.default.types.Test:
return generic;
default:
throw new Error(`
Platform must be one of the ones described in the documentation.
throw new Error(`
Platform must be one of the ones described in the documentation.
"${platform}" is currently not supported.`);
}
}
@ -3884,15 +3884,15 @@ class Input {
static get runNumber() {
return Input.getInput('GITHUB_RUN_NUMBER') || '0';
}
static get targetPlatform() {
return Input.getInput('targetPlatform') || platform_1.default.default;
}
static get unityVersion() {
return Input.getInput('unityVersion') || 'auto';
}
static get customImage() {
return Input.getInput('customImage');
}
static get targetPlatform() {
return Input.getInput('targetPlatform') || platform_1.default.default;
}
static get projectPath() {
const input = Input.getInput('projectPath');
const rawProjectPath = input
@ -3912,6 +3912,9 @@ class Input {
static get buildMethod() {
return Input.getInput('buildMethod') || ''; // processed in docker file
}
static get customParameters() {
return Input.getInput('customParameters') || '';
}
static get versioningStrategy() {
return Input.getInput('versioning') || 'Semantic';
}
@ -3943,21 +3946,9 @@ class Input {
static get androidTargetSdkVersion() {
return core.getInput('androidTargetSdkVersion') || '';
}
static get allowDirtyBuild() {
const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true';
}
static get customParameters() {
return Input.getInput('customParameters') || '';
}
static get sshAgent() {
return Input.getInput('sshAgent') || '';
}
static githubToken() {
return __awaiter(this, void 0, void 0, function* () {
return Input.getInput('githubToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || '';
});
}
static gitPrivateToken() {
return __awaiter(this, void 0, void 0, function* () {
return core.getInput('gitPrivateToken') || (yield Input.githubToken());
@ -3966,6 +3957,10 @@ class Input {
static get chownFilesTo() {
return Input.getInput('chownFilesTo') || '';
}
static get allowDirtyBuild() {
const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true';
}
static get postBuildSteps() {
return Input.getInput('postBuildSteps') || '';
}
@ -3975,27 +3970,32 @@ class Input {
static get customJob() {
return Input.getInput('customJob') || '';
}
static get cloudRunnerCluster() {
return Input.getInput('cloudRunnerCluster') || '';
}
static get awsBaseStackName() {
return Input.getInput('awsBaseStackName') || 'game-ci';
}
static get kubeConfig() {
return Input.getInput('kubeConfig') || '';
}
static get cloudRunnerMemory() {
return Input.getInput('cloudRunnerMemory') || '750M';
static get cloudRunnerCluster() {
return Input.getInput('cloudRunnerCluster') || 'local';
}
static get cloudRunnerCpu() {
return Input.getInput('cloudRunnerCpu') || '1.0';
}
static get kubeVolumeSize() {
return Input.getInput('kubeVolumeSize') || '5Gi';
static get cloudRunnerMemory() {
return Input.getInput('cloudRunnerMemory') || '750M';
}
static githubToken() {
return __awaiter(this, void 0, void 0, function* () {
return Input.getInput('githubToken') || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()) || '';
});
}
static get kubeConfig() {
return Input.getInput('kubeConfig') || '';
}
static get kubeVolume() {
return Input.getInput('kubeVolume') || '';
}
static get kubeVolumeSize() {
return Input.getInput('kubeVolumeSize') || '5Gi';
}
static ToEnvVarFormat(input) {
return input
.replace(/([A-Z])/g, ' $1')
@ -4177,10 +4177,10 @@ class SetupMac {
static installUnity(buildParameters, silent = false) {
return __awaiter(this, void 0, void 0, function* () {
const unityChangeset = yield unity_changeset_1.getUnityChangeset(buildParameters.version);
const command = `${this.unityHubPath} -- --headless install \
--version ${buildParameters.version} \
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
const command = `${this.unityHubPath} -- --headless install \
--version ${buildParameters.version} \
--changeset ${unityChangeset.changeset} \
--module mac-il2cpp \
--childModules`;
// Ignoring return code because the log seems to overflow the internal buffer which triggers
// a false error
@ -4292,8 +4292,8 @@ class ValidateWindows {
static validate(buildParameters) {
ValidateWindows.validateWindowsPlatformRequirements(buildParameters.platform);
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {
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
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
and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);
}
}
@ -4320,8 +4320,8 @@ class ValidateWindows {
//Check for Windows 10 SDK on runner
const windows10SDKPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits');
if (!windows10SDKPathExists) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
the runner has a Windows 10 SDK installed in the default
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.`);
}
}
@ -4330,8 +4330,8 @@ class ValidateWindows {
const visualStudioInstallPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');
const visualStudioDataPathExists = fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio');
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {
throw new Error(`Visual Studio not found at the default location.
Make sure the runner has Visual Studio installed in the
throw new Error(`Visual Studio not found at the default location.
Make sure the runner has Visual Studio installed in the
default location`);
}
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

60
dist/xhr-sync-worker.js vendored 100644
View File

@ -0,0 +1,60 @@
"use strict";
/* eslint-disable no-process-exit */
const util = require("util");
const { JSDOM } = require("../../../..");
const { READY_STATES } = require("./xhr-utils");
const idlUtils = require("../generated/utils");
const tough = require("tough-cookie");
const dom = new JSDOM();
const xhr = new dom.window.XMLHttpRequest();
const xhrImpl = idlUtils.implForWrapper(xhr);
const chunks = [];
process.stdin.on("data", chunk => {
chunks.push(chunk);
});
process.stdin.on("end", () => {
const buffer = Buffer.concat(chunks);
const flag = JSON.parse(buffer.toString());
if (flag.body && flag.body.type === "Buffer" && flag.body.data) {
flag.body = Buffer.from(flag.body.data);
}
if (flag.cookieJar) {
flag.cookieJar = tough.CookieJar.fromJSON(flag.cookieJar);
}
flag.synchronous = false;
Object.assign(xhrImpl.flag, flag);
const { properties } = xhrImpl;
xhrImpl.readyState = READY_STATES.OPENED;
try {
xhr.addEventListener("loadend", () => {
if (properties.error) {
properties.error = properties.error.stack || util.inspect(properties.error);
}
process.stdout.write(JSON.stringify({
responseURL: xhrImpl.responseURL,
status: xhrImpl.status,
statusText: xhrImpl.statusText,
properties
}), () => {
process.exit(0);
});
}, false);
xhr.send(flag.body);
} catch (error) {
properties.error += error.stack || util.inspect(error);
process.stdout.write(JSON.stringify({
responseURL: xhrImpl.responseURL,
status: xhrImpl.status,
statusText: xhrImpl.statusText,
properties
}), () => {
process.exit(0);
});
}
});

View File

@ -69,6 +69,10 @@ class Input {
return Input.getInput('GITHUB_RUN_NUMBER') || '0';
}
static get targetPlatform() {
return Input.getInput('targetPlatform') || Platform.default;
}
static get unityVersion() {
return Input.getInput('unityVersion') || 'auto';
}
@ -77,10 +81,6 @@ class Input {
return Input.getInput('customImage');
}
static get targetPlatform() {
return Input.getInput('targetPlatform') || Platform.default;
}
static get projectPath() {
const input = Input.getInput('projectPath');
const rawProjectPath = input
@ -104,6 +104,10 @@ class Input {
return Input.getInput('buildMethod') || ''; // processed in docker file
}
static get customParameters() {
return Input.getInput('customParameters') || '';
}
static get versioningStrategy() {
return Input.getInput('versioning') || 'Semantic';
}
@ -146,24 +150,10 @@ class Input {
return core.getInput('androidTargetSdkVersion') || '';
}
static get allowDirtyBuild() {
const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true';
}
static get customParameters() {
return Input.getInput('customParameters') || '';
}
static get sshAgent() {
return Input.getInput('sshAgent') || '';
}
static async githubToken() {
return Input.getInput('githubToken') || (await GithubCliReader.GetGitHubAuthToken()) || '';
}
static async gitPrivateToken() {
return core.getInput('gitPrivateToken') || (await Input.githubToken());
}
@ -172,6 +162,12 @@ class Input {
return Input.getInput('chownFilesTo') || '';
}
static get allowDirtyBuild() {
const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true';
}
static get postBuildSteps() {
return Input.getInput('postBuildSteps') || '';
}
@ -184,34 +180,38 @@ class Input {
return Input.getInput('customJob') || '';
}
static get cloudRunnerCluster() {
return Input.getInput('cloudRunnerCluster') || '';
}
static get awsBaseStackName() {
return Input.getInput('awsBaseStackName') || 'game-ci';
}
static get kubeConfig() {
return Input.getInput('kubeConfig') || '';
}
static get cloudRunnerMemory() {
return Input.getInput('cloudRunnerMemory') || '750M';
static get cloudRunnerCluster() {
return Input.getInput('cloudRunnerCluster') || 'local';
}
static get cloudRunnerCpu() {
return Input.getInput('cloudRunnerCpu') || '1.0';
}
static get kubeVolumeSize() {
return Input.getInput('kubeVolumeSize') || '5Gi';
static get cloudRunnerMemory() {
return Input.getInput('cloudRunnerMemory') || '750M';
}
static async githubToken() {
return Input.getInput('githubToken') || (await GithubCliReader.GetGitHubAuthToken()) || '';
}
static get kubeConfig() {
return Input.getInput('kubeConfig') || '';
}
static get kubeVolume() {
return Input.getInput('kubeVolume') || '';
}
static get kubeVolumeSize() {
return Input.getInput('kubeVolumeSize') || '5Gi';
}
public static ToEnvVarFormat(input: string) {
return input
.replace(/([A-Z])/g, ' $1')