Skip to content

Commit

Permalink
Merge remote-tracking branch 'Icosa/main'
Browse files Browse the repository at this point in the history
* Icosa/main:
  Document the secrets used in the CI (icosa-foundation#82)
  Packaging improvements (icosa-foundation#85)
  Build on PRs, push to main, or commits with [CI BUILD] somewhere in the message (icosa-foundation#75)
  Add Linux (regular + experimental) builds to the releases (icosa-foundation#76)
  Use secrets.UNITY_EMAIL/_PASSWORD/_SERIAL if present, otherwise use hardcoded free license (icosa-foundation#74)
  Create release upon each build and standardize version numbers (icosa-foundation#71)
  Change SketchFab uploads to upload as OpenBrush
  Don't request microphone permissions, no matter what (icosa-foundation#72)
  Add fly tool to advanced tools panel (icosa-foundation#63)
  Re-enable builds on all forks, but only sign if the secrets are present (icosa-foundation#69)
  Only run CI builds on icosa-gallery/open-brush (icosa-foundation#68)
  Enable Experimental builds for Android/Oculus and StandaloneWindows64/SteamVR (icosa-foundation#66)
  Improve and Document CI builds (icosa-foundation#65)
  Sign all builds that are built from pushes to main (icosa-foundation#64)
  Add CI Builds to PRs and pushes to main (icosa-foundation#43)
  • Loading branch information
billyquith committed Apr 7, 2021
2 parents 12114ea + 82e7935 commit fd09a85
Show file tree
Hide file tree
Showing 19 changed files with 1,431 additions and 285 deletions.
393 changes: 393 additions & 0 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,8 @@
/Assets/Oculus
/Assets/Oculus.meta

# In CI, this symlink is created to allow the updater to run. It should never go into source control
/Assets/Editor/OVRPluginUpdater.cs

# Cache files
*.cache
53 changes: 46 additions & 7 deletions Assets/Editor/BuildTiltBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class TiltBuildOptions {
public string Location;
public string Stamp;
public BuildOptions UnityOptions;
public bool Github;
}

[Serializable()]
Expand Down Expand Up @@ -264,6 +265,7 @@ public static TiltBuildOptions GetGuiOptions() {
UnityOptions = GuiDevelopment
? (BuildOptions.AllowDebugging | BuildOptions.Development)
: BuildOptions.None,
Github = false,
};
}

Expand Down Expand Up @@ -608,6 +610,18 @@ static void CommandLine() {
};
string keystoreName = null;
string keyaliasName = null;
string keystorePass = Environment.GetEnvironmentVariable("BTB_KEYSTORE_PASS");
string keyaliasPass = Environment.GetEnvironmentVariable("BTB_KEYALIAS_PASS");


#if OCULUS_SUPPORTED
// Call these once to create the files. Normally (i.e., in a GUI build), they're created with
// [UnityEditor.InitializeOnLoad], but in case they're missing, like in CI, make sure they're
// there!
OVRProjectConfig defaultOculusProjectConfig = OVRProjectConfig.GetProjectConfig();
string useless_app_id = Assets.Oculus.VR.Editor.OVRPlatformToolSettings.AppID;
#endif

{
string[] args = Environment.GetCommandLineArgs();
int i = 0;
Expand All @@ -628,12 +642,16 @@ static void CommandLine() {
tiltOptions.VrSdk = AsEnum(mode, tiltOptions.VrSdk);
} else if (args[i] == "-btb-experimental") {
tiltOptions.Experimental = true;
} else if (args[i] == "-btb-github") {
tiltOptions.Github = true;
} else if (args[i] == "-btb-il2cpp") {
tiltOptions.Il2Cpp = true;
} else if (args[i] == "-btb-bopt") {
tiltOptions.UnityOptions |= AsEnum(args[++i], BuildOptions.None);
} else if (args[i] == "-btb-target") {
target = AsEnum<BuildTarget>(args[++i]);
} else if (args[i] == "-customBuildPath") {
tiltOptions.Location = args[++i];
} else if (args[i] == "-btb-out") {
tiltOptions.Location = args[++i];
} else if (args[i] == "-btb-stamp") {
Expand All @@ -651,6 +669,22 @@ static void CommandLine() {
} else if (args[i] == "-btb-increment-bundle-version") {
// Don't restore this, because user might want to check in this change?
PlayerSettings.Android.bundleVersionCode += 1;
} else if (args[i] == "-buildVersion") {
// TODO: do we want to do anything with this? Can we use it instead of the version string
// set externally?
i++;
} else if (args[i] == "-androidVersionCode") {
PlayerSettings.Android.bundleVersionCode = Int32.Parse(args[++i]);
} else if (args[i] == "-androidKeystoreName") {
keystoreName = args[++i];
} else if (args[i] == "-androidKeystorePass") {
keystorePass = args[++i];
} else if (args[i] == "-androidKeyaliasName") {
keyaliasName = args[++i];
} else if (args[i] == "-androidKeyaliasPass") {
keyaliasPass = args[++i];
} else if (args[i] == "-setDefaultPlatformTextureFormat") {
i++;
} else {
Die(3, "Unknown argument {0}", args[i]);
EditorApplication.Exit(3);
Expand All @@ -670,8 +704,8 @@ static void CommandLine() {
}
tiltOptions.Target = target.Value;
using (var unused = new TempSetCommandLineOnlyPlayerSettings(
keystoreName, Environment.GetEnvironmentVariable("BTB_KEYSTORE_PASS"),
keyaliasName, Environment.GetEnvironmentVariable("BTB_KEYALIAS_PASS"))) {
keystoreName, keystorePass,
keyaliasName, keyaliasPass)) {
DoBuild(tiltOptions);
}
}
Expand Down Expand Up @@ -746,16 +780,21 @@ class TempSetAppNames : IDisposable {
private string m_name;
private string m_company;
private bool m_isAndroid;
public TempSetAppNames(bool isAndroid) {
public TempSetAppNames(bool isAndroid, bool isGithub) {
m_isAndroid = isAndroid;
m_identifier = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android);
m_name = PlayerSettings.productName;
m_company = PlayerSettings.companyName;
string new_name = App.kAppDisplayName;
string new_identifier = App.kGuiBuildAndroidApplicationIdentifier;
if (isGithub) {
new_name += " (Github)";
new_identifier += "-github";
}
if (m_isAndroid) {
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android,
App.kGuiBuildAndroidApplicationIdentifier);
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, new_identifier);
}
PlayerSettings.productName = App.kAppDisplayName;
PlayerSettings.productName = new_name;
PlayerSettings.companyName = App.kDisplayVendorName;
}

Expand Down Expand Up @@ -992,7 +1031,7 @@ public static void DoBuild(TiltBuildOptions tiltOptions) {
using (var unused4 = new TempHookUpSingletons())
using (var unused5 = new TempSetScriptingBackend(target, tiltOptions.Il2Cpp))
using (var unused6 = new TempSetBundleVersion(App.Config.m_VersionNumber, stamp))
using (var unused10 = new TempSetAppNames(target == BuildTarget.Android))
using (var unused10 = new TempSetAppNames(target == BuildTarget.Android, tiltOptions.Github))
using (var unused7 = new RestoreVrSdks())
using (var unused9 = new RestoreFileContents(
Path.Combine(Path.GetDirectoryName(Application.dataPath),
Expand Down
3 changes: 2 additions & 1 deletion Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<application
android:allowBackup="false"
tools:replace="android:allowBackup"
android:requestLegacyExternalStorage="true">
android:requestLegacyExternalStorage="true">
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
Expand All @@ -29,4 +29,5 @@
android:name="android.hardware.vr.headtracking"
android:version="1"
android:required="true" />
<uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/>
</manifest>
Loading

0 comments on commit fd09a85

Please sign in to comment.