diff --git a/.github/workflows/publish-release-build.yml b/.github/workflows/publish-release-build.yml index c0fe1cbc62..8f34e6d408 100644 --- a/.github/workflows/publish-release-build.yml +++ b/.github/workflows/publish-release-build.yml @@ -32,8 +32,8 @@ jobs: if: ${{ success() }} run: | FIRST_HEADING2=$(grep "^## " CHANGELOG.md | head -n 1) - if [[ "$FIRST_HEADING2" != "## [Unreleased]" ]]; then - echo "First heading at level 2 should be '## [Unreleased]'" + if [[ "$FIRST_HEADING2" =~ ^##[[:space:]]\[[0-9]+\.[0-9]+\.[0-9]+\][[:space:]]-[[:space:]][0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then + echo "First heading at level 2 should match '## [X.Y.Z] - [YYYY-MM-DD]'" exit 1 fi diff --git a/RELEASING.md b/RELEASING.md index 850f5a20d6..7dbe830ccc 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -14,7 +14,7 @@ Note: These steps should be done directly in the pinterest/ktlint repository, no 5. Add the new release to the bottom of the `CHANGELOG.md` file. 6. Push your changes to the branch, and merge it to `master`. 7. Update your local `pinterest/ktlint` `master` branch; verify you see the `gradle.properties` and `CHANGELOG.md` changes locally. -8. 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](https://github.com/pinterest/ktlint/actions/workflows/release.yml).Important: when you get an error like `HttpError: 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. +8. 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](https://github.com/pinterest/ktlint/actions/workflows/publish-release-build.yml).Important: when you get an error like `HttpError: 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. 9. 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=ktlint&sort=published 10. The `.announce` script has created the `-update-refs` branch in the repo. Create a new pull request (https://github.com/pinterest/ktlint/compare) and merge it to master. 11. Merge of branch `-update-refs` to master starts the `Publish release documentation` and `Publish snapshot documentation` workflows. 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.