UniGame Build Pipeline
Allow to make build pipeline with commands and group of commands and run from CI and Unity
com.unigame.unibuildpipeline Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/unibuildpipeline.git 
README Markdown
Copy this to your project's README.md
## Installation
Add **UniGame Build Pipeline** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/unibuildpipeline.git
```
[](https://www.pkglnk.dev/pkg/unibuildpipeline)Dependencies (2)
README
UniGame.BuildPipeline
Command-based scriptable build pipeline for Unity Engine

- UniGame.UniBuild
Quick Start
Opening Build Pipeline Editor
- Open Unity Editor
- Go to menu: Tools → Build Pipeline → Pipeline Editor
- The Build Pipeline Editor window will open
Creating Your First Pipeline
- In Project window, right-click and select: Create → UniBuild → UniBuild Pipeline
- Name it (e.g., "AndroidBuild")
- Open the Build Pipeline Editor (Tools → Build Pipeline → Pipeline Editor)
- Select your new configuration from the pipeline list (left panel)
- Click + Add Step to start adding commands
- Choose from available commands:
- For Android: ApplyAndroidSettingsCommand, SwitchActiveBuildTargetCommand
- For General: ApplyBuildArgumentsCommand, BuildOptionsCommand
- For Post-Build: Copy files, upload artifacts, etc.
Basic Usage
Configure Build Target
- Select the platform (Android, iOS, WebGL, etc.)
- Configure platform-specific settings
- (Optional) Use Unity Build Profiles for predefined platform configurations
Add Pre-Build Commands
- Set up build environment
- Apply build arguments and settings
- Configure platform-specific options
Execute Pipeline
- In Pipeline Editor, click "Run" button or use menu: Build → Run Build Configuration
- Monitor progress in Console window
- Pipeline respects active Build Profile settings
Add Post-Build Commands
- Copy artifacts to specific locations
- Trigger deployment processes
- Generate reports
Overview
UniGame.UniBuild is a comprehensive build automation system for Unity that provides:
- Command-Based Architecture: Modular build steps using command pattern
- Visual Pipeline Editor: Drag-drop UI for configuring build steps
- Multi-Platform Support: Unified build system for all Unity platforms
- Unity Build Profiles Support: Full integration with Unity 6 Build Profiles system
- Console Integration: Full command-line interface for CI/CD systems
- Extensible Commands: Rich set of built-in commands and easy custom command creation
Installation
Dependencies
Optional for enhanced Inspector:
- Odin Inspector - Advanced inspector features
- Tri-Inspector - Lightweight alternative
Wuthout these, you can use Pipeline Editor Window or default Unity Inspector for editing pipelines.
Package Installation
Add to your project manifest (Packages/manifest.json):
{
"dependencies": {
"com.unigame.unibuildpipeline": "https://github.com/UnioGame/unigame.buildpipeline.git",
}
}
Unity Build Profiles Support
UniGame.UniBuild fully supports Unity 6 Build Profiles system:
- Profile Integration: Each Build Profile can have its own pipeline configuration
- Automatic Activation: Build Profiles are automatically activated when executing pipelines
- Profile-Specific Commands: Configure different commands for different profiles
- Consistent Naming: Pipeline configurations follow Build Profile naming conventions
- Seamless Workflow: Works alongside Unity's native Build Profile system without conflicts
To use with Build Profiles:
- Create or select a Build Profile in Unity Editor (Window → Build Profile)
- Create a pipeline configuration that matches your profile strategy
- Configure commands to work with the active Build Profile
- When running the pipeline, it automatically respects the current profile settings
Core Architecture
Build System Components
The build system consists of key components:
// Main build configuration
public interface IUniBuildCommandsMap
{
bool PlayerBuildEnabled { get; }
IEnumerable<IUnityBuildCommand> PreBuildCommands { get; }
IEnumerable<IUnityBuildCommand> PostBuildCommands { get; }
}
// Base command interface
public interface IUnityBuildCommand
{
string Name { get; }
void Execute(IUniBuilderConfiguration configuration);
bool Validate(IUniBuilderConfiguration config);
}
Ready-to-use Base Classes:
UniGame.UniBuild provides two convenient base classes for implementing commands:
SerializableBuildCommand - For inline serializable commands
UnityBuildCommand - For ScriptableObject-based reusable commands
Both classes implement IUnityBuildCommand and handle all the boilerplate, allowing you to focus on the command logic in the Execute() method.
Build Pipeline Flow
Start Build
↓
Initialize Configuration
↓
Execute Pre-Build Commands (in order)
↓
Execute Unity Build (if enabled)
↓
Execute Post-Build Commands (in order)
↓
Generate Build Report
↓
Finish Build
Command System
Command Types
UniBuild supports:
- SerializableBuildCommand: Inline commands, serialized in pipeline
- UnityBuildCommand: ScriptableObject-based reusable commands
- IUnityBuildCommand: Base interface implemented by all commands
Creating Commands
Simple Serializable Command
using UniGame.UniBuild.Editor.Commands;
using UnityEngine;
[System.Serializable]
public class PrintBuildInfoCommand : SerializableBuildCommand
{
public string messagePrefix = "Build Info: ";
public override void Execute(IUniBuilderConfiguration configuration)
{
var target = configuration.BuildParameters.buildTarget;
var output = configuration.BuildParameters.outputFolder;
Debug.Log($"{messagePrefix}Target={target}, Output={output}");
}
}
Add to pipeline:
- Open Pipeline Editor
- Click "+ Add Step"
- Select "Print Build Info Command"
- Configure the prefix text if needed
ScriptableObject Command
Create a reusable command asset:
using UniGame.UniBuild.Editor.Commands;
using UnityEngine;
[CreateAssetMenu(menuName = "UniBuild/Commands/DeployCommand")]
public class DeployCommand : UnityBuildCommand
{
[SerializeField] private string deployPath = "Builds/";
[SerializeField] private bool deleteOld = true;
public override void Execute(IUniBuilderConfiguration configuration)
{
if (deleteOld && System.IO.Directory.Exists(deployPath))
System.IO.Directory.Delete(deployPath, true);
BuildLogger.Log($"Deployed to: {deployPath}");
}
}
Create asset:
- Right-click in Project
- Create → UniBuild → Commands → Deploy Command
- Drag-drop the asset into a pipeline step
Built-in Commands
Common pre-built commands available:
Platform Configuration
ApplyAndroidSettingsCommand- Android build settingsApplyWebGLSettingsCommand- WebGL configurationSwitchActiveBuildTargetCommand- Change build target
Build Setup
ApplyBuildArgumentsCommand- Apply command-line argumentsBuildOptionsCommand- Set Unity BuildOptionsSetScriptingBackendCommand- IL2CPP or MonoApplyArtifactNameCommand- Output filename
Asset Management
ReimportAssetsCommand- Reimport selected assetsApplyScriptingDefineSymbolsCommand- Manage #define symbols
View All Commands in Pipeline Editor
Open the Commands Catalog tab in the Build Pipeline Editor to browse all available commands with descriptions:

The Commands Catalog shows:
- All available commands with their metadata
- Command descriptions and categories
- Search functionality to find specific commands
- Real-time command discovery
Adding Command Metadata
Make your custom commands discoverable in the Commands Catalog by using the BuildCommandMetadataAttribute:
using UniGame.UniBuild.Editor.Inspector;
using UnityEngine;
[BuildCommandMetadata(
displayName: "Deploy to Server",
description: "Uploads the build artifacts to the deployment server",
category: "Deployment",
iconPath: "Assets/Icons/deploy.png"
)]
[System.Serializable]
public class DeployToServerCommand : SerializableBuildCommand
{
[SerializeField] private string serverUrl = "ftp://deploy.example.com";
[SerializeField] private bool deleteOldBuilds = true;
public override void Execute(IUniBuilderConfiguration configuration)
{
// Your deployment logic here
BuildLogger.Log($"Deploying to: {serverUrl}");
}
}
BuildCommandMetadataAttribute Parameters:
displayName- Human-readable command name shown in UIdescription- Detailed description of what the command doescategory- Category for organizing commands (e.g., "Deployment", "Platform", "Assets")iconPath- Optional path to icon asset for visual identification
The metadata is automatically used when:
- Adding steps in the Pipeline Editor
- Displaying commands in the Commands Catalog
- Building the command discovery system
Build Pipeline
Pipeline Execution
Pipelines automatically:
- Validate all commands before execution
- Execute pre-build commands in order (top to bottom)
- Build Unity player (if enabled)
- Execute post-build commands in order
- Generate build report with execution times
Command Groups
Group related commands for organization:
[CreateAssetMenu(menuName = "UniBuild/Create CommandsGroup")]
public class PipelineCommandsGroup : UnityBuildCommand
{
public BuildCommands commands = new BuildCommands();
public override void Execute(IUniBuilderConfiguration configuration)
{
foreach (var command in commands.Commands)
{
if (command.IsActive)
command.Execute(configuration);
}
}
}
Use in pipeline:
- Create group asset: Create → UniBuild → Create CommandsGroup
- Add as a step in pipeline
- Expand the group to add nested commands
- Commands in group execute together
Console Arguments
Common arguments:
-buildTarget- Build target (Android, iOS, WebGL, etc.)-bundleVersion- Version string-buildnumber- Build number-outputFolder- Output directory-outputFileName- Output filename-developmentBuild- Development build flag-gitBranch- Git branch name
Examples
Example 1: Custom Setup Command
[System.Serializable]
public class SetupProjectCommand : SerializableBuildCommand
{
[SerializeField] private bool clearCache = true;
public override bool Validate(IUniBuilderConfiguration config)
{
if (config.BuildParameters.buildTarget == BuildTarget.NoTarget)
{
Debug.LogError("Build target not set!");
return false;
}
return true;
}
public override void Execute(IUniBuilderConfiguration configuration)
{
var target = configuration.BuildParameters.buildTarget;
Debug.Log($"Setting up project for {target}");
if (clearCache)
System.IO.Directory.Delete("Library/ScriptAssemblies", true);
AssetDatabase.Refresh();
}
}
Best Practices
- Keep Commands Simple - Each command should do one thing well
- Validate Input - Always validate configuration before executing
- Use Logging - Use
BuildLogger.Log()for debugging and reporting - Group Related Commands - Use command groups for organization
- Test Locally - Test build pipelines locally before CI/CD integration
- Document Parameters - Add [Tooltip] attributes to command properties
- Order Matters - Arrange commands logically (setup before build, deploy after)
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In