# Build Automation and CI
A build that only exists on one person's machine is not a build you can teach, ship, or bisect. This Pipelines series covers **Build Profiles** in Unity 6, **command-line players**, **GameCI on GitHub Actions**, and **Unity Build Automation** (cloud builds from the Editor and the Dashboard). It assumes you already version the project as in [[Version Control]] / [[UVCS]] / [[Setting Up GitHub for Unity]], and that you can run tests from the command line as in [[Unity Test Framework]].
**Target:** Unity **6000.5+**. Quest player builds still follow the VR stack in this vault on **Unity 6.3 LTS (6000.3.27f2+)** ([[3.Quest 2 Project and Build Setup]]). CI can build 6.3 and 6.5 projects; the Build Profile and `-activeBuildProfile` flags exist on both, but confirm GameCI's Unity version images against the exact Editor you pin.
> [!warning] Code not compiled
> The Editor build script and the GitHub Actions workflow below were checked against the Unity 6000.5 command-line build page, the `BuildPlayerWithProfileOptions` / `BuildProfile` Scripting API, and GameCI's public v4 documentation on 2026-11-10. **They have not been run against a real Unity license, GitHub org, or Unity Dashboard project.**
> [!note] Verification status
> **Verified:** `-projectPath`, `-quit`, `-batchmode`, `-logFile`, `-buildTarget`, `-activeBuildProfile`, `-build`, `-executeMethod`; the batch-mode warning that `BuildProfile.SetActiveBuildProfile` and `EditorUserBuildSettings.SwitchActiveBuildTargetAsync` do not work as a platform switch mid-script; `BuildPipeline.BuildPlayer(BuildPlayerWithProfileOptions)`. Unity Build Automation package **2.1.1** is released for 6000.5 (2.1.0 and 2.0.8 also available). GameCI `unity-builder@v4` accepts a `buildProfile` input that maps to `-activeBuildProfile`.
> **Not verified:** every label in the 6000.5 Build Profiles window; GameCI's exact current secret names if the project has changed them since the docs fetched here — always follow [GameCI activation](https://game.ci/docs/github/activation) for the license you actually have; UBA Dashboard screens that can move.
## Parts
| # | Note | Covers |
|---|---|---|
| 1 | [[1. Build Profiles]] | The Build Profiles window, per-platform settings, scene lists |
| 2 | [[2. Command Line Builds and a Build Script]] | `-build`, `-activeBuildProfile`, `BuildPlayerWithProfileOptions` |
| 3 | [[3. GameCI and GitHub Actions]] | `unity-builder` / `unity-test-runner`, license secrets, caching |
| 4 | [[4. Unity Build Automation]] | Cloud builds from a profile, UBA package 2.1.1, Shelve and Build |
| 5 | [[5. Worked Example - Windows and Android Profiles]] | Two profiles, a script, a starter workflow |
| 6 | [[6. Build Automation Pitfalls]] | Licenses, batch-mode target switches, secrets, Quest CI |
## Design lens (Level Up!)
Level 18 in [[Level Up! (Review)]] is the pitch and the hard part: you need a **playable build**, not a laptop in Play Mode. For VR, the teaching notes already say to sideload via [[4.Quest 2 Testing and Deployment]]. CI is how that build is the same every week.
## Patterns used (Game Programming Patterns)
- **Command** - a build profile plus a command line is a packaged, repeatable action.
- **Type Object** - the profile *is* the type of build (Windows dev, Android Quest, release). Do not hide those differences in an unversioned Editor layout.
See [[Game Programming Patterns (Review)]].
## Related (existing)
- [[Version Control]], [[UVCS]], [[Setting Up GitHub for Unity]], [[Connecting an Existing Unity Project to a New GitHub Repository Using GitHub Desktop]]
- [[Unity Test Framework]] (especially [[6. Performance Tests Coverage and Command Line]])
- [[Architecture and Code Patterns]] - asmdefs and defines per profile
- [[3.Quest 2 Project and Build Setup]]
## Sources
- Create a build from the Editor / Build Profiles (6000.5): https://docs.unity.com/en-us/engine/6000.5/manual/building-and-publishing/build-settings
- Build a player from the command line (6000.5): https://docs.unity.com/en-us/engine/6000.5/manual/building-and-publishing/build-customize-build-pipeline/build-command-line
- `BuildProfile.SetActiveBuildProfile`: https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Build.Profile.BuildProfile.SetActiveBuildProfile.html
- Unity Build Automation package 2.1.1: https://docs.unity.com/en-us/engine/6000.5/manual/packages-list/packages-all/pack-safe/com-unity-services-cloud-build
- UBA Editor package / Shelve and Build: https://docs.unity.com/en-us/build-automation/build-automation-editor-package
- GameCI Unity Builder: https://github.com/game-ci/documentation/blob/main/docs/03-github/04-builder.mdx
- GameCI activation: https://game.ci/docs/github/activation