|
| 1 | +[workspace] |
| 2 | +semver_check = false |
| 3 | +git_release_enable = false |
| 4 | +changelog_update = false |
| 5 | +git_release_draft = true |
| 6 | +git_release_body = """ |
| 7 | +{{ changelog }} |
| 8 | +{% if remote.contributors %} |
| 9 | +### Contributors |
| 10 | +{% for contributor in remote.contributors %} |
| 11 | +* @{{ contributor.username }} |
| 12 | +{% endfor %} |
| 13 | +{% endif %} |
| 14 | +""" |
| 15 | + |
| 16 | +[changelog] |
| 17 | +header = """# Changelog |
| 18 | +
|
| 19 | +All notable changes to this project will be documented in this file. |
| 20 | +
|
| 21 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), \ |
| 22 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 23 | +
|
| 24 | +## [Unreleased] |
| 25 | +""" |
| 26 | + |
| 27 | +body = """ |
| 28 | +
|
| 29 | +## [{{ version }}]\ |
| 30 | + {%- if release_link -%}\ |
| 31 | + ({{ release_link }})\ |
| 32 | + {% endif %} \ |
| 33 | + - {{ now() | date(format="%Y-%m-%d") }} |
| 34 | +
|
| 35 | + {% if previous.version -%}\ |
| 36 | + [View diff on diff.rs](https://diff.rs/{{ package }}/{{ previous.version }}/{{ package }}/{{ version }}/Cargo.toml) |
| 37 | + {%- endif %} |
| 38 | +{% for group, group_commits in commits | filter(attribute="remote.pr_number") | sort(attribute="remote.pr_number") | reverse | group_by(attribute="group") %} |
| 39 | +### {{ group | striptags | trim | upper_first }} |
| 40 | +
|
| 41 | + {% for commit in group_commits | sort(attribute="breaking") | reverse %} |
| 42 | + {%- if commit.scope -%} |
| 43 | + - {% if commit.breaking %}[**breaking**] {% endif %}*({{commit.scope}})* \ |
| 44 | + {{ commit.message | upper_first }}{{ self::username(commit=commit) }} |
| 45 | + {% else -%} |
| 46 | + - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}{{ self::username(commit=commit) }} |
| 47 | + {% endif -%} |
| 48 | + {% endfor -%} |
| 49 | +{% endfor %} |
| 50 | +{%- for commit in commits -%} |
| 51 | + {%- if not commit.remote.pr_number %} |
| 52 | +- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}{{ self::username(commit=commit) }} |
| 53 | + {%- endif -%} |
| 54 | +{%- endfor %} |
| 55 | +{%- macro username(commit) -%} |
| 56 | + {% if commit.remote.username %} (by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }})){% endif -%} |
| 57 | +{% endmacro -%} |
| 58 | +""" |
| 59 | + |
| 60 | +protect_breaking_commits = true |
| 61 | +commit_parsers = [ |
| 62 | + { message = "^.*\\(security\\)", group = "<!-- 0 -->Security", scope = "" }, |
| 63 | + { message = "^feat", group = "<!-- 1 -->New features" }, |
| 64 | + { message = "^fix", group = "<!-- 2 -->Fixes" }, |
| 65 | + { message = "^.*", group = "<!-- 3 -->Other" }, |
| 66 | +] |
| 67 | +commit_preprocessors = [ |
| 68 | + # Replace multiple spaces with a single space. |
| 69 | + { pattern = " +", replace = " " }, |
| 70 | + # Replace the issue/PR number with the link. It will work for PRs as well as GitHub has a redirect. |
| 71 | + { pattern = "\\(#([0-9]+)\\)", replace = "([#${1}](https://github.com/cot-rs/cot/pull/${1}))" }, |
| 72 | + # Hyperlink bare commit hashes like "abcd1234" in commit logs, with short commit hash as description. |
| 73 | + { pattern = "([ \\n])(([a-f0-9]{7})[a-f0-9]*)", replace = "${1}commit [${3}](https://github.com/cot-rs/cot/commit/${2})" }, |
| 74 | + # Fix automatic revert commit name |
| 75 | + { pattern = "^Revert", replace = "chore(revert):" } |
| 76 | +] |
| 77 | + |
| 78 | +# git-cliff specific |
| 79 | +[git] |
| 80 | +filter_unconventional = false |
| 81 | + |
| 82 | +[[package]] |
| 83 | +name = "cot" |
| 84 | +changelog_update = true |
| 85 | +changelog_include = ["cot-codegen", "cot-macros", "cot-core"] |
| 86 | +changelog_path = "./CHANGELOG.md" |
| 87 | +git_release_enable = true |
| 88 | + |
| 89 | +[[package]] |
| 90 | +name = "cot-cli" |
| 91 | +changelog_update = true |
| 92 | +git_release_enable = true |
0 commit comments