发布不使用发布分支的集合

由于不使用发布分支,本节不区分发布主要版本、次要版本或补丁版本。

发布计划和公告

  1. 检查集合以确定是否有已合并的更改需要发布。

  2. 根据所做的更改,选择合适的发布版本号。请记住,集合必须遵循语义版本控制规则。有关详细信息,请参阅集合版本控制和弃用

  3. 在相应的固定发布问题或集合的社区公告板以及community Matrix/IRC 频道中宣布您发布集合的意图。

创建发布分支

  1. 确保您在本地 fork 的默认分支中。在以下示例中,我们使用 main

git status
git checkout main     # if needed
  1. 更新您的本地 fork

git pull --rebase upstream main
  1. 从默认分支检出一个新的发布分支

git checkout -b release_branch
  1. 确保 galaxy.yml 包含正确的发布版本号。

生成变更日志

  1. 添加一个变更日志片段 changelogs/fragments/X.Y.Z.yml,内容如下

release_summary: |-
  Write some text here that should appear as the release summary for this version.
  The format is reStructuredText, but not a list as for regular changelog fragments.
  This text will be inserted into the changelog.

例如

release_summary: |-
  This is the minor release of the ``community.mysql`` collection.
  This changelog contains all changes to the modules and plugins in this collection
  that have been made after the previous release.
  1. 如果内容最近从另一个集合中移动(例如,将一个模块从一个集合迁移到另一个集合),请确保在 changelogs/fragments 目录中包含所有相关的变更日志片段。如果不是,请事先复制它们。

  2. 运行 antsibull-changelog release --reload-plugins。此软件包应通过 pip install antsibull-changelog 安装。

  3. 验证 CHANGELOG.rst 是否看起来符合预期。

  4. 提交并将更改推送到 CHANGELOG.rstchangelogs/changelog.yaml,并可能将已删除/存档的片段推送到 origin 存储库的 release_branch

git commit -a -m "Release VERSION commit"
git push origin release_branch
  1. 在集合存储库中创建一个拉取请求。如果 CI 测试通过,则合并它。

  2. 检出默认分支并拉取更改

git checkout main
git pull --rebase upstream main

发布集合

  1. 使用集合版本向发布提交添加带注释的标签。将此标签推送到 upstream 存储库将使 Zuul 在Ansible Galaxy 上发布集合。

git tag -n    # see current tags and their comments
git tag -a NEW_VERSION -m "comment here"    # the comment can be, for example,  "community.postgresql: 1.2.0"
git push upstream NEW_VERSION
  1. 等待新版本发布到集合的 Ansible Galaxy 页面。它将显示在可供下载的 tarball 列表中。

  2. galaxy.yml 文件中的版本更新为下一个预期版本。添加、提交并推送到 upstream 的默认分支。

  3. 为新标签添加 GitHub 发布。标题应为版本,内容为 See https://github.com/ansible-collections/community.xxx/blob/main/CHANGELOG.rst for all changes

  4. 通过牛角通讯问题宣布发布。

  5. 在步骤 3 中提到的集合的固定发布问题/社区公告板以及community Matrix/IRC 频道中宣布发布。