This commit is contained in:
2026-06-23 01:19:20 +09:30
parent 734b4515a6
commit 32de402bbd
-58
View File
@@ -8,70 +8,12 @@ project {
description = "Unity CI - isolated platform builds"
buildType(UnityLicenseActivation)
buildType(WindowsBuild)
buildType(AndroidBuild)
buildType(MacBuild)
buildType(IOSBuild)
}
/**
* UNITY LICENSE ACTIVATION
* Run once per agent/machine or when licenses expire
*/
object UnityLicenseActivation : BuildType({
name = "Unity - License Activation"
vcs {
root(DslContext.settingsRoot)
}
params {
param("unity.executable", "C:/Program Files/Unity/Hub/Editor/2022.3.XXf1/Editor/Unity.exe")
// Store these as secure parameters in TeamCity (DO NOT hardcode)
password("unity.email", "credentialsJSON:REPLACE_ME")
password("unity.password", "credentialsJSON:REPLACE_ME")
password("unity.serial", "credentialsJSON:REPLACE_ME")
}
steps {
powerShell {
name = "Activate Unity License"
scriptContent = """
Write-Host "Checking Unity license activation..."
$unity = "%unity.executable%"
if (!(Test-Path $unity)) {
throw "Unity executable not found at: $unity"
}
Write-Host "Running Unity license activation..."
& $unity -quit -batchmode -nographics `
-serial "%unity.serial%" `
-username "%unity.email%" `
-password "%unity.password%" `
-logFile -
if ($LASTEXITCODE -ne 0) {
throw "Unity license activation failed (exit code: $LASTEXITCODE)"
}
Write-Host "Unity license activated successfully"
""".trimIndent()
}
}
requirements {
equals("teamcity.agent.os", "Windows")
}
})
/**
* WINDOWS (also builds Android on Windows agent)
*/