-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathrelease-plz.toml
More file actions
193 lines (163 loc) · 8.13 KB
/
Copy pathrelease-plz.toml
File metadata and controls
193 lines (163 loc) · 8.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# release-plz configuration
# https://release-plz.dev/docs/config
[workspace]
# Use the existing tag naming convention without 'v' prefix.
git_tag_name = "{{ package }}-{{ version }}"
git_release_name = "{{ package }}-{{ version }}"
# Enable all release features.
git_release_enable = true
git_tag_enable = true
publish = true
# The CI already runs cargo-semver-checks on every PR, so checking again at release time is
# redundant.
semver_check = false
# Bump minor version for non-bugfix commits.
custom_minor_increment_regex = """\
^(🎨|⚡️|🔥|✨|💄|🎉|🔒️|⬇️|⬆️|📌|➕|➖|🔧|👽️|💥|♿️|💬|🔊|🔇|🚸|🏗️|🗑️)\
"""
# PR configuration.
pr_name = "🔖 Releases"
# Changelog configuration for gimoji-based commits.
# See: https://zeenix.github.io/gimoji/
[changelog]
# Changelog header without the default [Unreleased] section.
header = """# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
"""
# Changelog body template.
# Each section heading carries the emoji of its category, so the leading emoji is stripped off
# the entries rather than repeated on every line. One regex both recognises and removes it, so
# the two can't disagree. It strips exactly one gimoji plus the whitespace after it, matching the
# commit contract: a subject carries one prefix emoji, and everything after it — another emoji
# included — is title text. So "✨ 🎉 Add foo" keeps its 🎉, and subjects with no separator after
# the prefix ("⚰️a Drop …", "✨🏳️🌈 Rainbow") stay visibly malformed rather than being mangled.
# The alternation is exactly the set of emoji this file routes to a group below; any other emoji
# lands in the catch-all, where nothing is stripped. Keep the two in step when adding a parser.
# The catch-all group is the exception: its heading emoji stands for no particular category, so
# the entry emoji there is information rather than repetition and is kept. Those entries render
# exactly as they did before this template existed.
# `upper_first` applies only when nothing was stripped, and sees the subject untrimmed, exactly
# as it did before. An emoji used to shield the rest of the subject from it; without that guard
# it would rewrite "zbus_macros shouldn't …" into "Zbus_macros shouldn't …" and
# "signature::Fields::len()" into "Signature::Fields::len()".
# Group names are prefixed with an "<!-- NN -->" ordering comment, which `striptags` drops from
# the rendered heading.
# Issue refs are separated by "||" delimiter so we can insert period before them.
body = """
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}\
{% set first_line = commit.message | split(pat="\n") | first %}\
{% set parts = first_line | split(pat="||") %}\
{% set subject = parts | first %}\
{% if group is ending_with("Other") %}\
{% set title = subject | upper_first %}\
{% else %}\
{% set title = subject | replace_regex(from="^\\s*(?:✨|🎉|🚸|🐛|🚑|🩹|🥅|⚡|📝|💡|♻|🎨|🚚|🔧|🏗|💄|💥|🔥|🗑|⬆|⬇|📌|➕|➖|🔒|✅|🧪|👷|💚)\\u{FE0F}?\\s+", to="") %}\
{% if title == subject %}{% set title = title | upper_first %}{% endif %}\
{% endif %}\
- {{ title | trim | trim_end_matches(pat=".") }}\
{% if commit.breaking %} (**BREAKING**){% endif %}.\
{% if parts | length > 1 %} {{ parts | last }}{% endif %}
{% endfor %}\
{% endfor %}\
"""
# Protect breaking change commits from being filtered out.
protect_breaking_commits = true
# Categorize commits based on gimoji emojis.
# See: https://zeenix.github.io/gimoji/
# The "<!-- NN -->" prefix on each group name fixes the order of the changelog sections
# (the template strips it); the emoji right after it becomes the section heading emoji.
commit_parsers = [
# Skip commits carrying a "Changelog: skip" trailer (see the preprocessor below).
{ message = "^changelog-skip$", skip = true },
# Skip merge commits, release commits, and empty commits (just emojis).
{ message = "^[Mm]erge", skip = true },
{ message = "^🔖", skip = true },
{ message = "^[\\p{Emoji}\\p{Emoji_Presentation}\\p{Extended_Pictographic}]+$", skip = true },
# Features.
{ message = "^✨", group = "<!-- 00 -->✨ Added" },
{ message = "^🎉", group = "<!-- 00 -->✨ Added" },
{ message = "^🚸", group = "<!-- 00 -->✨ Added" },
# Bug fixes.
{ message = "^🐛", group = "<!-- 07 -->🐛 Fixed" },
{ message = "^🚑", group = "<!-- 07 -->🐛 Fixed" },
{ message = "^🩹", group = "<!-- 07 -->🐛 Fixed" },
{ message = "^🥅", group = "<!-- 07 -->🐛 Fixed" },
# Performance.
{ message = "^⚡", group = "<!-- 09 -->⚡️ Performance" },
# Documentation.
{ message = "^📝", group = "<!-- 06 -->📝 Documentation" },
{ message = "^💡", group = "<!-- 06 -->📝 Documentation" },
# Refactoring/changes.
{ message = "^♻️", group = "<!-- 03 -->♻️ Changed" },
{ message = "^🎨", group = "<!-- 03 -->♻️ Changed" },
{ message = "^🚚", group = "<!-- 03 -->♻️ Changed" },
{ message = "^🔧", group = "<!-- 03 -->♻️ Changed" },
{ message = "^🏗️", group = "<!-- 03 -->♻️ Changed" },
{ message = "^💄", group = "<!-- 03 -->♻️ Changed" },
# Breaking changes/removals.
{ message = "^💥", group = "<!-- 01 -->💥 Breaking" },
{ message = "^🔥", group = "<!-- 10 -->🔥 Removed" },
{ message = "^🗑️", group = "<!-- 05 -->🗑️ Deprecated" },
# Dependencies.
{ message = "^⬆️", group = "<!-- 04 -->📦 Dependencies" },
{ message = "^⬇️", group = "<!-- 04 -->📦 Dependencies" },
{ message = "^📌", group = "<!-- 04 -->📦 Dependencies" },
{ message = "^➕", group = "<!-- 04 -->📦 Dependencies" },
{ message = "^➖", group = "<!-- 04 -->📦 Dependencies" },
# Security.
{ message = "^🔒", group = "<!-- 11 -->🔒️ Security" },
# Testing.
{ message = "^✅", group = "<!-- 12 -->✅ Testing" },
{ message = "^🧪", group = "<!-- 12 -->✅ Testing" },
# CI/Build.
{ message = "^👷", group = "<!-- 02 -->👷 CI" },
{ message = "^💚", group = "<!-- 02 -->👷 CI" },
# Everything else.
{ message = ".*", group = "<!-- 08 -->⚙️ Other" },
]
# Commit message preprocessors (applied in order).
# Remove package prefix (e.g., "core: " or "zlink-macros: ") but keep gimoji emojis.
# Pattern handles emojis with variation selectors (U+FE0F) and ZWJ sequences (U+200D).
[[changelog.commit_preprocessors]]
pattern = '^((?:[\p{Emoji_Presentation}\p{Extended_Pictographic}](?:\u{FE0F}|\u{200D})?)+) [\w, -]+: '
replace = "$1 "
# Extract issue refs from commit body using $COMMIT_SHA.
# Matches: "Fixes #123", "Closes issue #123", "Resolves bug #123", etc.
# Appends issue ref with "||" delimiter so template can insert period before it.
[[changelog.commit_preprocessors]]
pattern = ".*"
replace_command = '''
sh -c 'title=$(cat); \
ref=$(git log -1 --format=%b $COMMIT_SHA 2>/dev/null \
| grep -oE "(Fixes|Closes|Resolves).*#[0-9]+" \
| grep -oE "#[0-9]+" | head -1); \
if [ -n "$ref" ]; then printf "%s||%s\n" "$title" "$ref"; \
else printf "%s\n" "$title"; fi'
'''
# Replace the message of commits carrying a "Changelog: skip" git trailer with a sentinel
# that the first commit parser below drops (e.g. AI-workflow design docs and plans).
[[changelog.commit_preprocessors]]
pattern = ".*"
replace_command = '''
sh -c 'title=$(cat); \
if git log -1 --format="%(trailers:key=Changelog,valueonly)" $COMMIT_SHA 2>/dev/null \
| grep -qix skip; then echo changelog-skip; \
else printf "%s\n" "$title"; fi'
'''
# Version groups to keep related crates in sync.
# zlink and zlink-macros versions are kept in sync.
[[package]]
name = "zlink"
version_group = "zlink"
[[package]]
name = "zlink-macros"
version_group = "zlink"
# Don't publish the test integration crate.
[[package]]
name = "test-integration"
publish = false