Add input to set version code
Use action input `androidVersionCode` when provided. Generate the androidVersionCode from the version otherwise.
This commit is contained in:
committed by
Webber Takken
parent
401ddcaae0
commit
bdc3a88d22
@@ -28,6 +28,7 @@ namespace UnityBuilderAction
|
||||
|
||||
// Set version for this build
|
||||
VersionApplicator.SetVersion(options["version"]);
|
||||
VersionApplicator.SetAndroidVersionCode(options["androidVersionCode"]);
|
||||
|
||||
// Perform build
|
||||
BuildReport buildReport = BuildPipeline.BuildPlayer(buildOptions);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEditor;
|
||||
|
||||
namespace UnityBuilderAction.Versioning
|
||||
@@ -11,10 +10,14 @@ namespace UnityBuilderAction.Versioning
|
||||
if (version == "none") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Apply(version);
|
||||
}
|
||||
|
||||
public static void SetAndroidVersionCode(string androidVersionCode) {
|
||||
PlayerSettings.Android.bundleVersionCode = Int32.Parse(androidVersionCode);
|
||||
}
|
||||
|
||||
static void Apply(string version)
|
||||
{
|
||||
PlayerSettings.bundleVersion = version;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -109,8 +109,8 @@ xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||
-customBuildTarget "$BUILD_TARGET" \
|
||||
-customBuildPath "$CUSTOM_BUILD_PATH" \
|
||||
-executeMethod "$BUILD_METHOD" \
|
||||
-versioning "$VERSIONING" \
|
||||
-version "$VERSION" \
|
||||
-androidVersionCode "$ANDROID_VERSION_CODE" \
|
||||
$CUSTOM_PARAMETERS
|
||||
|
||||
# Catch exit code
|
||||
|
||||
Reference in New Issue
Block a user