mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
no wait, just repeat logs
This commit is contained in:
commit
a31896bdeb
BIN
dist/.DS_Store
vendored
Normal file
BIN
dist/.DS_Store
vendored
Normal file
Binary file not shown.
@ -29,12 +29,23 @@ namespace UnityBuilderAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
// Determine subtarget
|
||||||
|
StandaloneBuildSubtarget buildSubtarget;
|
||||||
|
if (!options.TryGetValue("standaloneBuildSubtarget", out var subtargetValue) || !Enum.TryParse(subtargetValue, out buildSubtarget)) {
|
||||||
|
buildSubtarget = default;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Define BuildPlayer Options
|
// Define BuildPlayer Options
|
||||||
var buildPlayerOptions = new BuildPlayerOptions {
|
var buildPlayerOptions = new BuildPlayerOptions {
|
||||||
scenes = scenes,
|
scenes = scenes,
|
||||||
locationPathName = options["customBuildPath"],
|
locationPathName = options["customBuildPath"],
|
||||||
target = (BuildTarget) Enum.Parse(typeof(BuildTarget), options["buildTarget"]),
|
target = (BuildTarget) Enum.Parse(typeof(BuildTarget), options["buildTarget"]),
|
||||||
options = buildOptions
|
options = buildOptions,
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
subtarget = (int) buildSubtarget
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set version for this build
|
// Set version for this build
|
||||||
|
@ -28,6 +28,7 @@ namespace UnityBuilderAction.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Enum.IsDefined(typeof(BuildTarget), buildTarget)) {
|
if (!Enum.IsDefined(typeof(BuildTarget), buildTarget)) {
|
||||||
|
Console.WriteLine($"{buildTarget} is not a defined {nameof(BuildTarget)}");
|
||||||
EditorApplication.Exit(121);
|
EditorApplication.Exit(121);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
@ -42,7 +42,7 @@
|
|||||||
"kubernetes-client": "^9.0.0",
|
"kubernetes-client": "^9.0.0",
|
||||||
"nanoid": "^3.3.1",
|
"nanoid": "^3.3.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.5.2",
|
||||||
"unity-changeset": "^2.0.0",
|
"unity-changeset": "^2.0.0",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"yaml": "^1.10.2"
|
"yaml": "^1.10.2"
|
||||||
|
@ -12,11 +12,11 @@ class SetupMac {
|
|||||||
public static async setup(buildParameters: BuildParameters, actionFolder: string) {
|
public static async setup(buildParameters: BuildParameters, actionFolder: string) {
|
||||||
const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}/Unity.app/Contents/MacOS/Unity`;
|
const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}/Unity.app/Contents/MacOS/Unity`;
|
||||||
|
|
||||||
if (!fs.existsSync(this.unityHubExecPath)) {
|
if (!fs.existsSync(this.unityHubExecPath.replace(/"/g, ''))) {
|
||||||
await SetupMac.installUnityHub(buildParameters);
|
await SetupMac.installUnityHub(buildParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fs.existsSync(unityEditorPath)) {
|
if (!fs.existsSync(unityEditorPath.replace(/"/g, ''))) {
|
||||||
await SetupMac.installUnity(buildParameters);
|
await SetupMac.installUnity(buildParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,23 +72,23 @@ class SetupMac {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getModuleParametersForTargetPlatform(targetPlatform: string): string {
|
private static getModuleParametersForTargetPlatform(targetPlatform: string): string[] {
|
||||||
let moduleArgument = '';
|
const moduleArgument = [];
|
||||||
switch (targetPlatform) {
|
switch (targetPlatform) {
|
||||||
case 'iOS':
|
case 'iOS':
|
||||||
moduleArgument += `--module ios `;
|
moduleArgument.push('--module', 'ios');
|
||||||
break;
|
break;
|
||||||
case 'tvOS':
|
case 'tvOS':
|
||||||
moduleArgument += '--module tvos ';
|
moduleArgument.push('--module', 'tvos');
|
||||||
break;
|
break;
|
||||||
case 'StandaloneOSX':
|
case 'StandaloneOSX':
|
||||||
moduleArgument += `--module mac-il2cpp `;
|
moduleArgument.push('--module', 'mac-il2cpp');
|
||||||
break;
|
break;
|
||||||
case 'Android':
|
case 'Android':
|
||||||
moduleArgument += `--module android `;
|
moduleArgument.push('--module', 'android');
|
||||||
break;
|
break;
|
||||||
case 'WebGL':
|
case 'WebGL':
|
||||||
moduleArgument += '--module webgl ';
|
moduleArgument.push('--module', 'webgl');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported module for target platform: ${targetPlatform}.`);
|
throw new Error(`Unsupported module for target platform: ${targetPlatform}.`);
|
||||||
@ -110,17 +110,21 @@ class SetupMac {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
const unityChangeset = await getUnityChangeset(buildParameters.editorVersion);
|
||||||
const moduleArgument = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);
|
||||||
|
|
||||||
const command = `${this.unityHubExecPath} -- --headless install \
|
const execArguments: string[] = [
|
||||||
--version ${buildParameters.editorVersion} \
|
'--',
|
||||||
--changeset ${unityChangeset.changeset} \
|
'--headless',
|
||||||
${moduleArgument} \
|
'install',
|
||||||
--childModules `;
|
...['--version', buildParameters.editorVersion],
|
||||||
|
...['--changeset', unityChangeset.changeset],
|
||||||
|
...moduleArguments,
|
||||||
|
'--childModules',
|
||||||
|
];
|
||||||
|
|
||||||
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
// Ignoring return code because the log seems to overflow the internal buffer which triggers
|
||||||
// a false error
|
// a false error
|
||||||
const errorCode = await exec(command, undefined, { silent, ignoreReturnCode: true });
|
const errorCode = await exec(this.unityHubExecPath, execArguments, { silent, ignoreReturnCode: true });
|
||||||
if (errorCode) {
|
if (errorCode) {
|
||||||
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
|
throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);
|
||||||
}
|
}
|
||||||
|
15
yarn.lock
15
yarn.lock
@ -5280,10 +5280,10 @@ saxes@^5.0.1:
|
|||||||
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
|
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
|
||||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||||
|
|
||||||
semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
|
semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2:
|
||||||
version "7.3.5"
|
version "7.5.2"
|
||||||
resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.2.tgz#5b851e66d1be07c1cdaf37dfc856f543325a2beb"
|
||||||
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
|
integrity sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
lru-cache "^6.0.0"
|
lru-cache "^6.0.0"
|
||||||
|
|
||||||
@ -5292,13 +5292,6 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.3.0:
|
|||||||
resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz"
|
resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz"
|
||||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||||
|
|
||||||
semver@^7.3.7:
|
|
||||||
version "7.3.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
|
|
||||||
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
|
|
||||||
dependencies:
|
|
||||||
lru-cache "^6.0.0"
|
|
||||||
|
|
||||||
shebang-command@^1.2.0:
|
shebang-command@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
|
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
|
||||||
|
Loading…
Reference in New Issue
Block a user