搭建游戏多平台自动构建流水线
按游戏引擎和目标平台编写持续集成配置,覆盖缓存、冒烟测试、调试符号与内测分发。
完整提示词
<context>
You set up automated builds for a small game team so every change produces playable builds for every platform without someone babysitting the editor. The usual pain: a full asset import takes an hour on a clean runner because the engine's library or derived-data cache is not kept; builds work only on one person's machine because the engine version drifts; crash reports from testers are useless because debug symbols were never uploaded; console and some engine builds need licences or SDKs that cannot run on hosted runners; and large binary assets blow past repository and cache limits.
Engine: {{engine}}
Platforms: {{platforms}}
{{#ci_system}}CI: {{ci_system}}{{/ci_system}}
</context>
<task>
{{#project_notes}}
<project_notes>
{{project_notes}}
</project_notes>
{{/project_notes}}
1. Pipeline overview: triggers (every push to main builds the fast platform; nightly builds all platforms; tags build release candidates), and which jobs run in parallel.
2. Runners and licences: hosted versus self-hosted per platform (macOS and iOS need Apple hardware; consoles need the platform holder's SDK under NDA and usually a self-hosted, access-controlled machine). Engine licence activation in CI (for example a build-server or serial activation for Unity, none needed for Godot), stored as secrets. Flag anything the user must check with the engine vendor or platform holder.
3. Build steps per platform, run headless from the command line with the exact engine version pinned (a container image or an installed version checked at job start): import, build, package, and the artefact name.
4. Caching: the engine's import cache (for example Unity's `Library` folder keyed on engine version and lock files, Unreal derived data cache, Godot's `.godot/imported`), Git LFS objects, and package caches; warn about cache size limits on hosted CI and when a shared network cache is worth it.
5. Versioning and symbols: version from tags plus a build number from the CI run, written into the build and shown on the title screen; debug symbols (PDB, dSYM, Android native symbols) uploaded to the crash reporter in the same job, kept for every distributed build.
6. Smoke tests: launch the built game headless or in batch mode, load the first scene, run a scripted short play-through or engine test runner, check it exits without errors within a timeout, and capture logs. Add engine unit and play-mode tests where they exist.
7. Distribution: internal testers (Steam beta branch via its build upload tool, itch.io via butler, TestFlight, Google Play internal testing), with release notes from commit messages and a channel notification. Store production releases stay manual.
8. Write the config for the CI system, or a neutral sketch with one example if none is named.
</task>
<constraints>
- Use the exact engine version given; never mix editor versions between jobs.
- Do not include console SDK details covered by NDAs; describe only the public shape and point to the platform holder's documentation.
- Licences, store credentials and signing keys are secrets in the CI secret store and never in the repo or logs.
- Do not invent runner prices or build times; ask or give how to measure them.
</constraints>
<output_format>
## Pipeline overview
Triggers and jobs as a short list or diagram.
## Runners and licences
Table: platform | runner | licence or SDK needs | notes.
## Build steps per platform
Numbered per platform with the command line.
## Caching
Bullets with cache keys.
## Versioning and symbols
Bullets.
## Smoke tests
Bullets with pass criteria.
## Distribution
Table: audience | channel | trigger.
## Config
Fenced blocks.
## Open questions
Bullets, or "None".
</output_format>可替换内容
- {{engine}}
- {{platforms}}
- {{#ci_system}}
- {{ci_system}}
- {{/ci_system}}
- {{#project_notes}}
- {{project_notes}}
- {{/project_notes}}
分类与标签
编程开发、游戏构建、持续集成、多平台发布、构建缓存、冒烟测试