more
This commit is contained in:
Vendored
+179
-25
@@ -1,38 +1,192 @@
|
|||||||
import jetbrains.buildServer.configs.kotlin.*
|
import jetbrains.buildServer.configs.kotlin.*
|
||||||
|
|
||||||
/*
|
|
||||||
The settings script is an entry point for defining a TeamCity
|
|
||||||
project hierarchy. The script should contain a single call to the
|
|
||||||
project() function with a Project instance or an init function as
|
|
||||||
an argument.
|
|
||||||
|
|
||||||
VcsRoots, BuildTypes, Templates, and subprojects can be
|
|
||||||
registered inside the project using the vcsRoot(), buildType(),
|
|
||||||
template(), and subProject() methods respectively.
|
|
||||||
|
|
||||||
To debug settings scripts in command-line, run the
|
|
||||||
|
|
||||||
mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate
|
|
||||||
|
|
||||||
command and attach your debugger to the port 8000.
|
|
||||||
|
|
||||||
To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View
|
|
||||||
-> Tool Windows -> Maven Projects), find the generate task node
|
|
||||||
(Plugins -> teamcity-configs -> teamcity-configs:generate), the
|
|
||||||
'Debug' option is available in the context menu for the task.
|
|
||||||
*/
|
|
||||||
|
|
||||||
version = "2026.1"
|
version = "2026.1"
|
||||||
|
|
||||||
project {
|
project {
|
||||||
|
|
||||||
buildType(WindowsMain)
|
description = "Unity CI pipeline with multi-target build fan-out"
|
||||||
|
|
||||||
|
// =========================
|
||||||
|
// CORE BUILD (shared logic)
|
||||||
|
// =========================
|
||||||
|
buildType(UnityBuildCore)
|
||||||
|
|
||||||
|
// =========================
|
||||||
|
// TRIGGERED BUILDS (fan-out)
|
||||||
|
// =========================
|
||||||
|
buildType(WindowsBuild)
|
||||||
|
buildType(AndroidBuild)
|
||||||
|
|
||||||
|
// Future-ready (disabled until you enable them)
|
||||||
|
buildType(MacBuild)
|
||||||
|
buildType(IOSBuild)
|
||||||
}
|
}
|
||||||
|
|
||||||
object WindowsMain : BuildType({
|
/**
|
||||||
name = "windows main"
|
* =========================
|
||||||
|
* CORE UNITY BUILD PIPELINE
|
||||||
|
* =========================
|
||||||
|
* This is the ONLY build that actually runs Unity.
|
||||||
|
* Everything else just sets parameters and depends on this.
|
||||||
|
*/
|
||||||
|
object UnityBuildCore : BuildType({
|
||||||
|
|
||||||
|
name = "Unity Build (Core)"
|
||||||
|
|
||||||
|
description = "Runs Unity with a selected target"
|
||||||
|
|
||||||
|
params {
|
||||||
|
|
||||||
|
// Default fallback (should never be used in real triggers)
|
||||||
|
param("unity.target", "")
|
||||||
|
|
||||||
|
// Optional CI metadata
|
||||||
|
param("build.configuration", "Release")
|
||||||
|
}
|
||||||
|
|
||||||
vcs {
|
vcs {
|
||||||
root(DslContext.settingsRoot)
|
root(DslContext.settingsRoot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
steps {
|
||||||
|
|
||||||
|
powerShell {
|
||||||
|
name = "Run Unity Build"
|
||||||
|
scriptMode = file {
|
||||||
|
path = "ci/Build-Unity.ps1"
|
||||||
|
}
|
||||||
|
|
||||||
|
scriptArgs = "-Target %unity.target%"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
features {
|
||||||
|
// Ensures build log is captured cleanly
|
||||||
|
feature {
|
||||||
|
type = "xml-report-plugin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifactRules = """
|
||||||
|
Builds/** => builds.zip
|
||||||
|
""".trimIndent()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* =========================
|
||||||
|
* WINDOWS BUILD ENTRYPOINT
|
||||||
|
* =========================
|
||||||
|
* Triggered automatically on VCS changes
|
||||||
|
*/
|
||||||
|
object WindowsBuild : BuildType({
|
||||||
|
|
||||||
|
name = "Unity - Windows"
|
||||||
|
|
||||||
|
description = "Build Windows standalone"
|
||||||
|
|
||||||
|
params {
|
||||||
|
param("unity.target", "Windows")
|
||||||
|
}
|
||||||
|
|
||||||
|
vcs {
|
||||||
|
root(DslContext.settingsRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
steps {
|
||||||
|
// Snapshot dependency ensures correct ordering
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
snapshot(UnityBuildCore) {
|
||||||
|
onDependencyFailure = FailureAction.FAIL_TO_START
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifactRules = """
|
||||||
|
Builds/Windows/** => WindowsBuild.zip
|
||||||
|
""".trimIndent()
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* =========================
|
||||||
|
* ANDROID BUILD ENTRYPOINT
|
||||||
|
* =========================
|
||||||
|
*/
|
||||||
|
object AndroidBuild : BuildType({
|
||||||
|
|
||||||
|
name = "Unity - Android"
|
||||||
|
|
||||||
|
description = "Build Android AAB/APK"
|
||||||
|
|
||||||
|
params {
|
||||||
|
param("unity.target", "Android")
|
||||||
|
}
|
||||||
|
|
||||||
|
vcs {
|
||||||
|
root(DslContext.settingsRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
snapshot(UnityBuildCore) {
|
||||||
|
onDependencyFailure = FailureAction.FAIL_TO_START
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
artifactRules = """
|
||||||
|
Builds/Android/** => AndroidBuild.zip
|
||||||
|
""".trimIndent()
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* =========================
|
||||||
|
* MAC BUILD (future ready)
|
||||||
|
* =========================
|
||||||
|
* Requires macOS agent + Xcode
|
||||||
|
*/
|
||||||
|
object MacBuild : BuildType({
|
||||||
|
|
||||||
|
name = "Unity - Mac (Disabled)"
|
||||||
|
|
||||||
|
description = "Future macOS build target"
|
||||||
|
|
||||||
|
params {
|
||||||
|
param("unity.target", "Mac")
|
||||||
|
}
|
||||||
|
|
||||||
|
vcs {
|
||||||
|
root(DslContext.settingsRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
snapshot(UnityBuildCore) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
enabled = false
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* =========================
|
||||||
|
* iOS BUILD (future ready)
|
||||||
|
* =========================
|
||||||
|
* Requires macOS agent + Xcode + provisioning profiles
|
||||||
|
*/
|
||||||
|
object IOSBuild : BuildType({
|
||||||
|
|
||||||
|
name = "Unity - iOS (Disabled)"
|
||||||
|
|
||||||
|
description = "Future iOS build target"
|
||||||
|
|
||||||
|
params {
|
||||||
|
param("unity.target", "iOS")
|
||||||
|
}
|
||||||
|
|
||||||
|
vcs {
|
||||||
|
root(DslContext.settingsRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
snapshot(UnityBuildCore) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
enabled = false
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user