mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-13 09:23:52 -07:00
Add optional argument to action
This commit is contained in:
committed by
frostebite
parent
2321712bb4
commit
a12e3e829e
@@ -47,6 +47,10 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
description: 'Custom parameters to configure the build.'
|
description: 'Custom parameters to configure the build.'
|
||||||
|
useHostNetwork:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: 'Initialises Docker using the host network. (Linux only)'
|
||||||
versioning:
|
versioning:
|
||||||
required: false
|
required: false
|
||||||
default: 'Semantic'
|
default: 'Semantic'
|
||||||
|
|||||||
+7
-1
@@ -327,6 +327,7 @@ class BuildParameters {
|
|||||||
androidExportType: input_1.default.androidExportType,
|
androidExportType: input_1.default.androidExportType,
|
||||||
androidSymbolType: androidSymbolExportType,
|
androidSymbolType: androidSymbolExportType,
|
||||||
customParameters: input_1.default.customParameters,
|
customParameters: input_1.default.customParameters,
|
||||||
|
useHostNetwork: input_1.default.useHostNetwork,
|
||||||
sshAgent: input_1.default.sshAgent,
|
sshAgent: input_1.default.sshAgent,
|
||||||
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
|
||||||
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
||||||
@@ -637,7 +638,7 @@ class Docker {
|
|||||||
return await (0, exec_1.exec)(runCommand, undefined, options);
|
return await (0, exec_1.exec)(runCommand, undefined, options);
|
||||||
}
|
}
|
||||||
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {
|
||||||
const { workspace, actionFolder, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
const { workspace, actionFolder, useHostNetwork, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;
|
||||||
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
||||||
if (!(0, node_fs_1.existsSync)(githubHome))
|
if (!(0, node_fs_1.existsSync)(githubHome))
|
||||||
(0, node_fs_1.mkdirSync)(githubHome);
|
(0, node_fs_1.mkdirSync)(githubHome);
|
||||||
@@ -670,6 +671,7 @@ class Docker {
|
|||||||
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'
|
||||||
: ''} \
|
: ''} \
|
||||||
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \
|
||||||
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \
|
||||||
${image} \
|
${image} \
|
||||||
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
${entrypointBash ? `-c` : `${commandPrefix} -c`} \
|
||||||
@@ -1382,6 +1384,10 @@ class Input {
|
|||||||
static get customParameters() {
|
static get customParameters() {
|
||||||
return Input.getInput('customParameters') ?? '';
|
return Input.getInput('customParameters') ?? '';
|
||||||
}
|
}
|
||||||
|
static get useHostNetwork() {
|
||||||
|
const input = Input.getInput('useHostNetwork') ?? false;
|
||||||
|
return input === 'true';
|
||||||
|
}
|
||||||
static get versioningStrategy() {
|
static get versioningStrategy() {
|
||||||
return Input.getInput('versioning') ?? 'Semantic';
|
return Input.getInput('versioning') ?? 'Semantic';
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user