我正在为我的 Flutter CI 使用 Codemagic。对于我的存储库,我使用单一存储库结构。所以我将我的存储库分成了 +20 个本地包。对于每个包,我都运行自己的工作流程(分析、测试、格式化等)。
由于包数量较多,变成codemagic.yaml文件很大,可读性下降。
借助 GitHub Actions,我可以将工作流程拆分为多个文件,这大大提高了可读性(每个包一个文件)。
最佳答案
我询问了 Codemagic 团队,得到了这样的答案:
Unfortunately we do not plan on introducing the feature to split configurations into multiple different files at this point.
[But] there’s a couple of things you could look at doing. Firstly, take a look into using YAML anchors and aliases so you don’t repeat scripts. Here’s a guide and a sample codemagic.yaml. The other option is to use the Codemagic REST API to trigger your builds and pass app specific environment variables for the build. In this was you can has a single workflow which you pass the variables too. See more about the API here. There’s a few script samples here that show how to call it, and this yaml shows where the environment variables are overwritten.
关于cicd - 使用 Codemagic 是否可以拥有多个 codemagic.yaml 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71222399/