Add action to return license
parent
662d5ec5bf
commit
6ecd75635c
|
@ -52,7 +52,13 @@ async function runMain() {
|
||||||
mac_builder_1.default.run(actionFolder);
|
mac_builder_1.default.run(actionFolder);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await model_1.Docker.run(baseImage.toString(), { workspace, actionFolder, ...buildParameters });
|
if (buildParameters.customParameters === 'return_license') {
|
||||||
|
await model_1.Docker.run(baseImage.toString(), { workspace, actionFolder, ...buildParameters }, false, '', [],
|
||||||
|
undefined, false, true, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
await model_1.Docker.run(baseImage.toString(), { workspace, actionFolder, ...buildParameters }, );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5778,7 +5784,7 @@ const node_path_1 = __importDefault(__nccwpck_require__(49411));
|
||||||
class Docker {
|
class Docker {
|
||||||
static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [],
|
static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [],
|
||||||
// eslint-disable-next-line unicorn/no-useless-undefined
|
// eslint-disable-next-line unicorn/no-useless-undefined
|
||||||
options = undefined, entrypointBash = false, errorWhenMissingUnityBuildResults = true) {
|
options = undefined, entrypointBash = false, errorWhenMissingUnityBuildResults = true, returnLicense = false) {
|
||||||
let runCommand = '';
|
let runCommand = '';
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'linux':
|
case 'linux':
|
||||||
|
@ -5787,6 +5793,9 @@ class Docker {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
runCommand = this.getWindowsCommand(image, parameters);
|
runCommand = this.getWindowsCommand(image, parameters);
|
||||||
}
|
}
|
||||||
|
if (returnLicense === true) {
|
||||||
|
runCommand = this.getWindowsCommandReturnLicense(image, parameters);
|
||||||
|
}
|
||||||
if (options) {
|
if (options) {
|
||||||
options.silent = silent;
|
options.silent = silent;
|
||||||
await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults);
|
await exec_with_error_check_1.execWithErrorCheck(runCommand, undefined, options, errorWhenMissingUnityBuildResults);
|
||||||
|
@ -5846,6 +5855,26 @@ class Docker {
|
||||||
${image} \
|
${image} \
|
||||||
powershell c:/steps/entrypoint.ps1`;
|
powershell c:/steps/entrypoint.ps1`;
|
||||||
}
|
}
|
||||||
|
static getWindowsCommandReturnLicense(image, parameters) {
|
||||||
|
const { workspace, actionFolder, unitySerial, gitPrivateToken, dockerWorkspacePath } = parameters;
|
||||||
|
return `docker run \
|
||||||
|
--workdir c:${dockerWorkspacePath} \
|
||||||
|
--rm \
|
||||||
|
${image_environment_factory_1.default.getEnvVarString(parameters)} \
|
||||||
|
--env UNITY_SERIAL="${unitySerial}" \
|
||||||
|
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
||||||
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
|
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
||||||
|
--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" \
|
||||||
|
--volume "${actionFolder}/default-build-script":"c:/UnityBuilderAction" \
|
||||||
|
--volume "${actionFolder}/platforms/windows":"c:/steps" \
|
||||||
|
--volume "${actionFolder}/BlankProject":"c:/BlankProject" \
|
||||||
|
${image} \
|
||||||
|
powershell c:/steps/return_license.ps1`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports["default"] = Docker;
|
exports["default"] = Docker;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue