diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml index dcfed99ca..1d408d341 100644 --- a/.github/workflows/pre_release.yaml +++ b/.github/workflows/pre_release.yaml @@ -28,6 +28,7 @@ jobs: with: release_type: prerelease existing_changelog_path: CHANGELOG.md + cliff_config_path: cliff.toml wait_for_checks: name: Wait for code checks to pass diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e6f75894c..14dec60ce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -42,6 +42,7 @@ jobs: release_type: ${{ inputs.release_type }} custom_version: ${{ inputs.custom_version }} existing_changelog_path: CHANGELOG.md + cliff_config_path: cliff.toml # If github.ref points to a [skip ci] commit, we assume that it was added by the pre_release workflow, # which doesn't push the commit if code checks don't pass. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aacfe566..2ac26da55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. -## 1.6.3 - **not yet released** +## 1.6.3 ### ๐Ÿš€ Features diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 000000000..6dca13215 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,114 @@ +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration +# +# Based on the built-in config of apify/actions/git-cliff-release, with the +# unreleased heading changed so it no longer renders "- **not yet released**". + +[changelog] +# changelog body will be rendered even if there are no releases to process - required for pre-release version bumps +render_always = true +# changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{% if not version %} +{% endif %}\ +{% if version and extra.release_link %}\ + ## [{{ version | trim_start_matches(pat="v") }}]({{ extra.release_link }}) ({{ timestamp | date(format="%Y-%m-%d") }}) +{% elif extra.unreleased_version %}\ + ## {{ extra.unreleased_version | trim_start_matches(pat="v") }} +{% elif version %} + ## {{ version | trim_start_matches(pat="v") }} ({{ timestamp | date(format="%Y-%m-%d") }}) +{% else %}\ + ## Unreleased +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}**{{ commit.scope }}:** {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {% if commit.extra.pr_link %}\ + {{ commit.message | escape | upper_first | replace(from=commit.extra.raw_pr_link, to=commit.extra.pr_link) }}\ + {% else %}\ + {{ commit.message | escape | upper_first }}\ + {% endif %}\ + {% if commit.extra.commit_link %} ([{{ commit.id | truncate(length = 7, end = "") }}]({{ commit.extra.commit_link }})){% endif %}\ + {% if commit.extra.username and extra.is_release_notes %}\ + {{" "}}by @{{ commit.extra.username }}\ + {% elif commit.extra.username %}\ + {{" "}}by [@{{ commit.extra.username }}](https://github.com/{{ commit.extra.username }})\ + {% if commit.extra.closed_issue_links %}\ + , closes {{ commit.extra.closed_issue_links | join(sep = ", ") }}\ + {% endif %}\ + {%- endif %}\ + {% endfor %} +{% endfor %}\n +{% if not version %} +{% endif %}\ +""" +# template for the changelog footer +footer = """ + +""" +# remove the leading and trailing s +trim = true +# postprocessors +postprocessors = [] + +[bump] +# Version used for repositories with no existing tags. The "v" prefix keeps it +# matching tag_pattern, so setting up a brand-new repo works out of the box. +initial_tag = "v0.1.0" +# With 0.x.y version, breaking commits should only increase the minor version and feature commits should only increase the patch version +breaking_always_bump_major = false +features_always_bump_minor = false + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat|^patch", group = "๐Ÿš€ Features" }, + { message = "^fix|^bug", group = "๐Ÿ› Bug Fixes" }, + { message = "^docs(\\(.+\\))?!:", group = "๐Ÿ“š Documentation" }, + { message = "^docs", skip = true }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor(\\(.+\\))?!:", group = "๐Ÿšœ Refactor" }, + { message = "^refactor", skip = true }, + { message = "^style(\\(.+\\))?!:", group = "๐ŸŽจ Styling" }, + { message = "^style", skip = true }, + { message = "^test(\\(.+\\))?!:", group = "๐Ÿงช Testing" }, + { message = "^test", skip = true }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^(chore|ci)(\\(.+\\))?!:", group = "โš™๏ธ Miscellaneous Tasks" }, + { message = "^chore|^ci", skip = true }, + { message = "^build(\\(.+\\))?!:", group = "๐Ÿ—๏ธ Build" }, + { message = "^build", skip = true }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = true +# filter out the commits that are not matched by commit parsers +filter_commits = false +# regex for matching git tags +tag_pattern = "v[0-9]+\\." +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" +# limit the number of commits included in the changelog. +# limit_commits = 42