ReleasingCollections - ansible/community GitHub Wiki
Releasing without Release Branches (for "smaller" collections)
These instructions assume that publishing the collection is done via Zuul, and that antsibull-changelog is used for the changelog. Since no release branches are used, the instructions do not distinguish between releasing a major, minor or patch version.
-
Be sure you are in a default branch in your local fork:
git checkout DEFAULT_BRANCH -
Update your local fork:
git pull --rebase upstream DEFAULT_BRANCH -
Checkout a new release branch from main:
git checkout -b release_branch -
Make sure that
galaxy.ymlcontains the correct version number. If not, update it! -
Add a changelog fragment
changelogs/fragments/X.Y.Z.ymlwith content: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 verbatimly inserted into the changelog.Add to git and commit.
-
If the content was recently moved from another collection, be sure you have all related changelog fragments in
changelogs/fragmentsdirectory. If not, copy them previously. -
Run
antsibull-changelog release(should previously be installed bypip install antsibull-changelog). -
Verify that
CHANGELOG.rstlooks good. -
Commit and push changes to
CHANGELOG.rstandchangelogs/changelog.yaml, and potentially deleted/archived fragments tooriginrepository'srelease_branch.git commit -a -m "Release VERSION commit" git push origin release_branch -
Create a pull request in the collection repository. If CI tests pass, merge it.
-
Checkout the default branch and pull the changes:
git checkout DEFAULT_BRANCH git pull --rebase upstream DEFAULT_BRANCH -
Add an annotated tag to the release commit with the collection version. Pushing this tag to
upstreamwill make Zuul publish the collection.git tag -n # see current tags and their comments git tag -a NEW_VERSION -m "comment here" # comment can be, for example, "community.postgresql: 1.2.0" git push upstream NEW_VERSION -
Update the version in
galaxy.ymlto the next (expected) version. Add, commit and push toupstream'smainbranch.NOTE For repositories using AZP, only push once AZP has started for the previously pushed commit. Otherwise, due to pushing several commits in a row, AZP's batch feature might skip CI for the release commit - which violates the requirements (background).
-
Put a note about the release in https://github.com/ansible/community/issues/546 to have it published by the Bullhorn newsletter.
Releasing with Release Branches (for example community.general and community.network)
These instructions assume that publishing the collection is done via Zuul, and that antsibull-changelog is used for the changelog.
Announcements are made in the issues https://github.com/ansible-collections/community.general/issues/582 and https://github.com/ansible-collections/community.network/issues/81.
Releasing Major Versions
The new version is assumed to be X.0.0.
-
Create a branch
stable-Xand push to the repository. -
Update the version in
galaxy.ymlin themainbranch to the next (expected) version. For community.general and community.network, it will beX.1.0. Add, commit and push. From this point on, themainbranch is expecting changes for the next minor/major versions. -
In community.general and community.network, create new labels
backport-Xandneeds_backport_to_stable_X. Copy the styles and descriptions from the correspondingX-1labels. -
Replace
changelogs/changelog.yamlwith:ancestor: X.0.0 releases: {}Also remove all changelog fragments from
changelogs/fragments/. Add, commit and push.(This ensures that every major release has a changelog describing changes since the last major release.)
-
Now switch back to the
stable-Xbranch. -
In the
stable-Xbranch, make sure thatgalaxy.ymlcontains the correct version numberX.0.0. If not, update it! -
In the
stable-Xbranch, add a changelog fragmentchangelogs/fragments/X.0.0.ymlwith content: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 verbatimly inserted into the changelog.Add to git and commit.
Suggestion for the fragment:
release_summary: This is release 2.0.0 of ``community.foo``, released on YYYY-MM-DD. -
In the
stable-Xbranch, runantsibull-changelog release --cummulative-release. -
In the
stable-Xbranch, verify thatCHANGELOG.rstlooks good. -
In the
stable-Xbranch, update README.md so that the changelog link points to/tree/stable-X/and no longer to/tree/main/, and add?branchName=stable-Xto the AZP CI badge (https://dev.azure.com/ansible/community.xxx/_apis/build/status/CI?branchName=stable-X). -
In the
stable-Xbranch, add, commit and push changes toREADME.md,CHANGELOG.rstandchangelogs/changelog.yaml, and potentially deleted/archived fragments. -
In the
stable-Xbranch, add a tag to the last commit namedX.0.0. Pushing this tag will make Zuul publish the collection. -
In the
stable-Xbranch, update the version ingalaxy.ymlto the next (expected) version, i.e.X.1.0. Add, commit and push.NOTE For repositories using AZP, only push once AZP has started for the previously pushed commit. Otherwise, due to pushing several commits in a row, AZP's batch feature might skip CI for the release commit - which violates the requirements (background).
-
Write an announcement to the corresponding issue, and update the next (expected) version there.
-
Add GitHub release for this tag. Title should be the version, and content
See https://github.com/ansible-collections/community.xxx/blob/stable-X/CHANGELOG.rst for all changes..
Releasing Minor Versions
The new version is assumed to be X.Y.0. All changes that should go into it are expected to be in the stable-X branch (cherry-picked from main, either manually or by bot).
-
In the
stable-Xbranch, make sure thatgalaxy.ymlcontains the correct version numberX.Y.0. If not, update it! -
In the
stable-Xbranch, add a changelog fragmentchangelogs/fragments/X.Y.0.ymlwith content: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 verbatimly inserted into the changelog.Add to git and commit.
-
In the
stable-Xbranch, runantsibull-changelog release. -
In the
stable-Xbranch, verify thatCHANGELOG.rstlooks good. -
In the
stable-Xbranch, add, commit and push changes toCHANGELOG.rstandchangelogs/changelog.yaml, and potentially deleted/archived fragments. -
In the
stable-Xbranch, add a tag to the last commit namedX.Y.0. Pushing this tag will make Zuul publish the collection. -
In the
stable-Xbranch, update the version ingalaxy.ymlto the next (expected) version, i.e.X.(Y+1).0, orX.Y.1if no more minor releases will be made. Add, commit and push.NOTE For repositories using AZP, only push once AZP has started for the previously pushed commit. Otherwise, due to pushing several commits in a row, AZP's batch feature might skip CI for the release commit - which violates the requirements (background).
-
In the
mainbranch:-
If more minor versions are released before the next major version, update the version in
galaxy.ymltoX.(Y+1).0as well. Add, commit and push. -
If the next version will be a new major version, create a PR where you update the version in
galaxy.ymlto(X+1).0.0. Note that the sanity tests will most likely fail since there will be deprecations with removal scheduled for(X+1).0.0, which are flagged by the tests.For every such deprecation, decide whether to remove them now (makes sense if complete modules/plugins are removed, or redirects are removed), or whether to add
ignore.txtentries and create issues (makes sense for removed features in modules/plugins). Once CI passes, merge. Make sure that this PR is merged not too much later after the release forverison_addedsanity tests to not expect the wrong version for new feature PRs.(It makes sense to already do some removals in the days before the release. These removals must happen in the
mainbranch and must not be backported.)
-
-
Write an announcement to the corresponding issue, and update the next (expected) version there.
-
Add GitHub release for this tag. Title should be the version, and content
See https://github.com/ansible-collections/community.xxx/blob/stable-X/CHANGELOG.rst for all changes..
Releasing Patch Versions (more minor versions expected)
The new version is assumed to be X.Y.Z, and the previous patch version is assumed to be X.Y.z with z < Z (probably z is 0, as patch releases should be uncommon).
This is a bit more complicated, since the stable-X branch potentially already contains commits that should not go into a patch release.
- Checkout the
X.Y.ztag. - Update
galaxy.ymlso that the version isX.Y.Z. Add and commit. - Cherry-pick all changes from
stable-Xthat were added afterX.Y.zand should go intoX.Y.Z. - Add a changelog fragment
changelogs/fragments/X.Y.Z.ymlwith content:
Add to git and commit.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 verbatimly inserted into the changelog. - Run
antsibull-changelog release. - Verify that
CHANGELOG.rstlooks good. - Add and commit changes to
CHANGELOG.rstandchangelogs/changelog.yaml, and potentially deleted/archived fragments. - Add a tag to the last commit named
X.Y.Z. Pushing this tag will make Zuul publish the collection. - Write an announcement to the corresponding issue. Also update the next expected release.
- Add GitHub release for this tag. Title should be the version, and content
See https://github.com/ansible-collections/community.xxx/blob/stable-X/CHANGELOG.rst for all changes..
The data for this release is only contained in a tag, and not in a branch (in particular not in stable-X). This is intended, since the next minor release X.(Y+1).0 already contains the changes for X.Y.Z as well (since these were cherry-picked from stable-X).
Releasing Patch Versions (no more minor versions planned)
The new version is assumed to be X.Y.Z, and the previous patch version is assumed to be X.Y.z with z < Z (probably z is 0, as patch releases should be uncommon).
-
In the
stable-Xbranch, make sure thatgalaxy.ymlcontains the correct version numberX.Y.Z. If not, update it! -
In the
stable-Xbranch, add a changelog fragmentchangelogs/fragments/X.Y.Z.ymlwith content: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 verbatimly inserted into the changelog.Add to git and commit.
-
In the
stable-Xbranch, runantsibull-changelog release. -
In the
stable-Xbranch, verify thatCHANGELOG.rstlooks good. -
In the
stable-Xbranch, add, commit and push changes toCHANGELOG.rstandchangelogs/changelog.yaml, and potentially deleted/archived fragments. -
In the
stable-Xbranch, add a tag to the last commit namedX.Y.Z. Pushing this tag will make Zuul publish the collection. -
In the
stable-Xbranch, update the version ingalaxy.ymlto the next (expected) version, i.e.X.Y.(Z+1). Add, commit and push.NOTE For repositories using AZP, only push once AZP has started for the previously pushed commit. Otherwise, due to pushing several commits in a row, AZP's batch feature might skip CI for the release commit - which violates the requirements (background).
-
Write an announcement to the corresponding issue. Also update the next expected release.
-
Add GitHub release for this tag. Title should be the version, and content
See https://github.com/ansible-collections/community.xxx/blob/stable-X/CHANGELOG.rst for all changes..