Unity Custom Build Updater is a Unity package designed to streamline the build process for your Unity projects. It automates versioning, archiving, and build path management, making it easier to manage and distribute builds. This package is particularly useful for WebGL builds.
- Automatic version incrementing based on build type (Major, Feature, Bugfix, Build)
- Customizable build paths with default and custom options
- Automatic archiving of builds into zip files
- Simple initialization and configuration through a Unity Editor window
To install the Unity Custom Build Updater package, follow these steps:
- Open your Unity project.
- Go to
Window > Package Manager
. - Click on the
+
button in the top left corner. - Select
Add package from git URL...
. - Paste the following URL:
https://github.com/RimuruDev/Unity-CustomBuildUpdater.git
- Click
Add
.
After installing the package, you need to initialize the build configuration. Follow these steps:
- Go to
RimuruDev Tools > Initialize BuildConfig
in the top menu. - This will create a
BuildConfig
asset inAssets/Resources/Editor/BuildConfig.asset
.
The BuildConfig
asset contains the following settings:
- Company Name: The name of your company.
- Product Name: The name of your product.
- Initial Version: The starting version of your build (e.g.,
1.0.0.0
). - Build Path Type: The type of build path (
Default
orCustom
). - Custom Build Path: The custom build path if
Build Path Type
is set toCustom
. - Archive Build: Whether to archive the build into a zip file.
- Version Type: The type of version increment (
Major
,Feature
,Bugfix
,Build
). - Version Pattern: The pattern for the version naming (e.g.,
com.{company}.{product}.v{version}
).
using UnityEngine;
namespace RimuruDev.Unity_CustomBuildUpdater.CustomBuildUpdater.Editor
{
[CreateAssetMenu(fileName = "BuildConfig", menuName = "Configs/Build/BuildConfig", order = 1)]
public class BuildConfig : ScriptableObject
{
public string companyName = "AbyssMoth";
public string productName = "SuperGame";
public string initialVersion = "1.0.0.0";
public BuildPathType buildPathType = BuildPathType.Default;
public string customBuildPath = "Builds";
public bool archiveBuild = true;
public VersionType versionType = VersionType.Build;
public string versionPattern = "com.{company}.{product}.v{version}";
}
}
To update the current version in the configuration:
- Open the
BuildConfig
asset. - Click on the
Update Current Version
button.
To build the project using the configured settings:
- Go to
File > Build Settings
. - Configure your build settings as needed (make sure to select WebGL if testing WebGL builds).
- Click on
Build
and select the folder for your build.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.