mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Merge branch 'main' into ejnarvala/main
# Conflicts: # dist/index.js.map
This commit is contained in:
commit
c31e6aefd9
@ -74,7 +74,7 @@ namespace UnityBuilderAction
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Debug.LogError($"Failed to run default addressables build:\n{e}");
|
Debug.LogError("Failed to run default addressables build:\n" + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,17 +56,17 @@ namespace UnityBuilderAction.Input
|
|||||||
case "androidStudioProject":
|
case "androidStudioProject":
|
||||||
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
|
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
|
||||||
if (buildAppBundle != null)
|
if (buildAppBundle != null)
|
||||||
buildAppBundle.SetValue(null, false);
|
buildAppBundle.SetValue(null, false, null);
|
||||||
break;
|
break;
|
||||||
case "androidAppBundle":
|
case "androidAppBundle":
|
||||||
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
||||||
if (buildAppBundle != null)
|
if (buildAppBundle != null)
|
||||||
buildAppBundle.SetValue(null, true);
|
buildAppBundle.SetValue(null, true, null);
|
||||||
break;
|
break;
|
||||||
case "androidPackage":
|
case "androidPackage":
|
||||||
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
|
||||||
if (buildAppBundle != null)
|
if (buildAppBundle != null)
|
||||||
buildAppBundle.SetValue(null, false);
|
buildAppBundle.SetValue(null, false, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +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)}");
|
Console.WriteLine(buildTarget + " is not a defined " + typeof(BuildTarget).Name);
|
||||||
EditorApplication.Exit(121);
|
EditorApplication.Exit(121);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,10 +41,10 @@ namespace UnityBuilderAction.Input
|
|||||||
const string defaultCustomBuildName = "TestBuild";
|
const string defaultCustomBuildName = "TestBuild";
|
||||||
string customBuildName;
|
string customBuildName;
|
||||||
if (!validatedOptions.TryGetValue("customBuildName", out customBuildName)) {
|
if (!validatedOptions.TryGetValue("customBuildName", out customBuildName)) {
|
||||||
Console.WriteLine($"Missing argument -customBuildName, defaulting to {defaultCustomBuildName}.");
|
Console.WriteLine("Missing argument -customBuildName, defaulting to" + defaultCustomBuildName);
|
||||||
validatedOptions.Add("customBuildName", defaultCustomBuildName);
|
validatedOptions.Add("customBuildName", defaultCustomBuildName);
|
||||||
} else if (customBuildName == "") {
|
} else if (customBuildName == "") {
|
||||||
Console.WriteLine($"Invalid argument -customBuildName, defaulting to {defaultCustomBuildName}.");
|
Console.WriteLine("Invalid argument -customBuildName, defaulting to" + defaultCustomBuildName);
|
||||||
validatedOptions.Add("customBuildName", defaultCustomBuildName);
|
validatedOptions.Add("customBuildName", defaultCustomBuildName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,11 +57,11 @@ namespace UnityBuilderAction.Input
|
|||||||
string[] args = Environment.GetCommandLineArgs();
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
Console.WriteLine(
|
Console.WriteLine(
|
||||||
$"{EOL}" +
|
EOL +
|
||||||
$"###########################{EOL}" +
|
"###########################" + EOL +
|
||||||
$"# Parsing settings #{EOL}" +
|
"# Parsing settings #" + EOL +
|
||||||
$"###########################{EOL}" +
|
"###########################" + EOL +
|
||||||
$"{EOL}"
|
EOL
|
||||||
);
|
);
|
||||||
|
|
||||||
// Extract flags with optional values
|
// Extract flags with optional values
|
||||||
@ -78,7 +78,7 @@ namespace UnityBuilderAction.Input
|
|||||||
string displayValue = secret ? "*HIDDEN*" : "\"" + value + "\"";
|
string displayValue = secret ? "*HIDDEN*" : "\"" + value + "\"";
|
||||||
|
|
||||||
// Assign
|
// Assign
|
||||||
Console.WriteLine($"Found flag \"{flag}\" with value {displayValue}.");
|
Console.WriteLine("Found flag \"" + flag + "\" with value " + displayValue);
|
||||||
providedArguments.Add(flag, value);
|
providedArguments.Add(flag, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace UnityBuilderAction.Reporting
|
|||||||
prefix = "error";
|
prefix = "error";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Console.WriteLine($"{Environment.NewLine}::{prefix} ::{condition}{Environment.NewLine}{stackTrace}");
|
Console.WriteLine(Environment.NewLine + "::" + prefix + "::" + condition + Environment.NewLine + stackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,16 @@ namespace UnityBuilderAction.Reporting
|
|||||||
public static void ReportSummary(BuildSummary summary)
|
public static void ReportSummary(BuildSummary summary)
|
||||||
{
|
{
|
||||||
Console.WriteLine(
|
Console.WriteLine(
|
||||||
$"{EOL}" +
|
EOL +
|
||||||
$"###########################{EOL}" +
|
"###########################" + EOL +
|
||||||
$"# Build results #{EOL}" +
|
"# Build results #" + EOL +
|
||||||
$"###########################{EOL}" +
|
"###########################" + EOL +
|
||||||
$"{EOL}" +
|
EOL +
|
||||||
$"Duration: {summary.totalTime.ToString()}{EOL}" +
|
"Duration: " + summary.totalTime.ToString() + EOL +
|
||||||
$"Warnings: {summary.totalWarnings.ToString()}{EOL}" +
|
"Warnings: " + summary.totalWarnings.ToString() + EOL +
|
||||||
$"Errors: {summary.totalErrors.ToString()}{EOL}" +
|
"Errors: " + summary.totalErrors.ToString() + EOL +
|
||||||
$"Size: {summary.totalSize.ToString()} bytes{EOL}" +
|
"Size: " + summary.totalSize.ToString() + " bytes" + EOL +
|
||||||
$"{EOL}"
|
EOL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,11 +21,11 @@ namespace UnityBuilderAction.Versioning
|
|||||||
version = GetSemanticCommitVersion();
|
version = GetSemanticCommitVersion();
|
||||||
Console.WriteLine("Repository has a valid version tag.");
|
Console.WriteLine("Repository has a valid version tag.");
|
||||||
} else {
|
} else {
|
||||||
version = $"0.0.{GetTotalNumberOfCommits()}";
|
version = "0.0." + GetTotalNumberOfCommits();
|
||||||
Console.WriteLine("Repository does not have tags to base the version on.");
|
Console.WriteLine("Repository does not have tags to base the version on.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine($"Version is {version}");
|
Console.WriteLine("Version is " + version);
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
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.
@ -207,7 +207,21 @@ export default class Versioning {
|
|||||||
* identifies the current commit.
|
* identifies the current commit.
|
||||||
*/
|
*/
|
||||||
static async getVersionDescription() {
|
static async getVersionDescription() {
|
||||||
return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);
|
const versionTags = (await this.git(['tag', '--list', '--merged', 'HEAD', '--sort=-creatordate']))
|
||||||
|
.split('\n')
|
||||||
|
.filter((tag) => new RegExp(this.grepCompatibleInputVersionRegex).test(tag));
|
||||||
|
|
||||||
|
if (versionTags.length === 0) {
|
||||||
|
core.warning('No valid version tags found. Using fallback description.');
|
||||||
|
|
||||||
|
return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);
|
||||||
|
}
|
||||||
|
|
||||||
|
const latestVersionTag = versionTags[0];
|
||||||
|
const commitsCount = (await this.git(['rev-list', `${latestVersionTag}..HEAD`, '--count'])).trim();
|
||||||
|
const commitHash = (await this.git(['rev-parse', '--short', 'HEAD'])).trim();
|
||||||
|
|
||||||
|
return `${latestVersionTag}-${commitsCount}-g${commitHash}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user