在 YAML 管道中一次构建多个分支

Build multiple branches at once in a YAML pipeline

我有以下需求:我想要 produce/publish 一个由多个分支构建的结果的工件。

示例:我有 release/Update2、release/Update3、release/Update4,我想构建它们中的每一个以获得 Update2/Task.exe、Update3/Task。 exe,Update4/Task.exe。然后将它们压缩到 release.zip.

我想在 YAML 中执行此操作,但找不到说明如何同时构建不同分支的文档。我的另一个解决方案是在 Azure DevOps 上创建一个发布管道,但我不能在 YAML 中这样做。

有办法吗?

您可以使用您的 yaml 构建一个默认分支(如 release/Update2)。此外,添加到 yaml Command Line task with git checkout --force "your_branch" and build steps. Consider using build templates to simplify your yaml file: Template types & usage