Note: These steps should be done directly in the pinterest/ktlint repository, not in your personal fork.
- Create a new branch (e.g.
0.50.0-prep) - Manually run GitHub Action workflow https://github.com/pinterest/ktlint/actions/workflows/generate-changelog.yml to generate the new changelog based on the PR's since last release
- Check whether each PR is listed in the correct category. If not, add the proper label to the PR and repeat. See https://github.com/pinterest/ktlint/blob/master/.github/workflows/generate-changelog.yml#L35 for which labels to use.
- Copy the generated changelog from build step
Echo generated changelogto theCHANGELOG.mdfile - The generated changelog only contains the PR titles. For most changes this should be sufficient. For breaking API changes, it is better to add additional information. To indent this explanation correctly, append
(two spaces) to the end of the previous line.
- Update
VERSION_NAMEwith the new release version in the project rootgradle.properties. Be sure to remove-SNAPSHOT. - Update
CHANGELOG.mdto rename theUnreleasedsection to the new release name, following the## [x.x.x] - YYYY-MM-DDformat. - Add the new release to the bottom of the
CHANGELOG.mdfile. - Push your changes to the branch, and merge it to
master. - Update your local
pinterest/ktlintmasterbranch; verify you see thegradle.propertiesandCHANGELOG.mdchanges locally. - Add a tag with the new release version, and push it directly to remote (e.g.
git tag 0.50.0 && git push origin 0.50.0). This will kick off the Release workflow.Important: when you get an error likeHttpError: refusing to allow a Personal Access Token to create or update workflow '.github/workflows/automerge-triggers.yml' without 'workflow' scope, the GitHub personal access token is most likely expired. When this happens on the bump of the Homebrew formula, the personal access token of @shashachu needs to be updated. - Close and release the repo on Sonatype. Only Pinterest employees can do this. Wait with steps below until artifacts are published on https://central.sonatype.com/search?q=com.pinterest.ktlint&sort=published
- The
.announcescript has created the<release>-update-refsbranch in the repo. Create a new pull request (https://github.com/pinterest/ktlint/compare) and merge it to master. - Merge of branch
<release>-update-refsto master starts thePublish release documentationandPublish snapshot documentationworkflows. Check that both workflows succeed (https://github.com/pinterest/ktlint/actions). Also check that the documentation has actually been published on https://pinterest.github.io/ktlint/latest. - Verify that documentation of new release is published correctly. Especially check whether version numbers in documentation have been changed. After publication of
1.0.0the documentation still referred to0.50.0(according to https://github.com/pinterest/ktlint/actions/runs/6085301212/job/16509057702#step:11:14 it tried updating0.49.1to1.0.0which most likely was caused by the already fixed issue that the changelog heading of the0.50.0did not comply to the expected format). - Verify that the published documentation does not contain broken links with Broken Link Checker Tool.
- Announce release on Ktlint Slack channel but wait with doing so until sonatype release is closed by Pinterest.
- Update
gradle.propertieswith the newSNAPSHOTversion