Build Types - Avalin/Unity-CI-CD GitHub Wiki
π Build Types in CI/CD Pipeline
This page explains how build types are determined and used in the CI/CD pipeline. Build types control how the system interprets incoming events, what kind of build or release it should execute, and what outputs are produced.
The system supports three main build types:
| Build Type | Description |
|---|---|
preview |
For development, preview, or test builds (non-production) |
release_candidate |
For staging builds, e.g., v1.2.3-rc.1 |
release |
For final production releases, e.g., v1.2.3 |
π How Build Type Is Determined
The pipeline resolves the build type in the following order:
1οΈβ£ Tests-only Override
If the pipeline is run with TESTS_ONLY=true,
β
it always forces buildType=preview.
This ensures that test-only runs donβt accidentally trigger release or candidate pipelines.
2οΈβ£ Manual Override
If a manual override is provided via input (BUILD_TYPE_OVERRIDE),
β
it is accepted only if itβs one of:
previewrelease_candidaterelease
Invalid or unsupported types are not allowed
because workflows are only dispatched by explicit, validated choice
(e.g., through a manual dispatch form with dropdowns or options).
This guarantees no accidental or invalid values go in.
3οΈβ£ Automatic Detection (from event + ref)
When no manual override is present, the pipeline inspects the GitHub event type and git ref:
| GitHub Event | Git Ref Pattern | Resolved Build Type |
|---|---|---|
pull_request |
(any) | preview |
push |
refs/tags/vX.Y.Z (e.g., v1.2.3) |
release |
push |
refs/tags/vX.Y.Z-rc.N (e.g., v1.2.3-rc.1) |
release_candidate |
push |
anything else (branch pushes, etc.) | preview |
| other events | (fallback) | preview |
This ensures:
- Pull requests always run as previews.
- Tagged pushes (matching version or RC patterns) trigger releases.
- Regular branch pushes default to previews.
β οΈ Semantic Versioning (SemVer) Requirements
The system requires SemVer-compliant tags for releases and release candidates:
β Release Tags:
- Must follow
vX.Y.Z(e.g.,v1.2.3)
β Release Candidate Tags:
- Should ideally follow
vX.Y.Z-rc.N(e.g.,v1.2.3-rc.1) - If you dispatch only
v1.2.3and setrelease_candidateas the build type,
the system can automatically calculate the-rc.Nsuffix internally.
This allows flexible RC pipelines without requiring the exact RC tag to be inserted.
π‘ Example Use Cases
β
Preview Build (Pull Request)
A developer opens a pull request β buildType=preview
β
Preview Build (Manual Dispatch)
A developer manually dispatches the workflow
and explicitly selects preview from the buildType dropdown β buildType=preview
β
Release Candidate (Manual Dispatch)
A developer manually dispatches the workflow
with buildType=release_candidate and base version v2.0.0 β system calculates v2.0.0-rc.N
β
Release Candidate (Tag Push)
A tag like v2.0.0-rc.3 is pushed β buildType=release_candidate
β
Final Release (Manual Dispatch)
A developer manually dispatches the workflow
with buildType=release and version v2.0.0 β buildType=release
β
Final Release (Tag Push)
A tag like v2.0.0 is pushed β buildType=release
π¬ Questions?
If youβre unsure which build type your workflow will resolve to, check:
- The workflow logs β look for the Resolved build type log line. In the dispatcher, you'll find it in the
Prepare Metadataworkflow. - The value of
$BUILD_TYPEor$buildTypein later workflow steps.