-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrelease-plz.toml
More file actions
143 lines (119 loc) Β· 5.22 KB
/
release-plz.toml
File metadata and controls
143 lines (119 loc) Β· 5.22 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
# release-plz configuration
# https://release-plz.dev/docs/config
[workspace]
# Use the existing tag naming convention without 'v' prefix.
git_tag_name = "{{ version }}"
git_release_name = "{{ version }}"
# Enable all release features.
git_release_enable = true
git_tag_enable = true
publish = true
# We're not a library.
semver_check = false
# Bump minor version for non-bugfix commits.
custom_minor_increment_regex = """\
^(π¨|β‘οΈ|π₯|β¨|π|π|ποΈ|β¬οΈ|β¬οΈ|π|β|β|π§|π½οΈ|π₯|βΏοΈ|π¬|π|π|πΈ|ποΈ|ποΈ)\
"""
# PR configuration.
pr_name = "π Release {{ version }}"
# 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.
# 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 | upper_first }}
{% for commit in commits %}\
{% set first_line = commit.message | split(pat="\n") | first %}\
{% set parts = first_line | split(pat="||") %}\
- {{ parts | first | upper_first | 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
# Commit message preprocessors (applied in order).
commit_preprocessors = [
# Filter out non-latest dependency updates (keep only most recent bump per dependency).
# Pattern: "β¬οΈ *Update <dep> to <version>" - if newer commit updates same dep, skip this.
# Non-latest commits are prefixed with "π" to trigger the release-commit skip rule.
{ pattern = "^β¬οΈ +Update [^ ]+ to ", replace_command = """sh -c '
msg=$(cat)
dep=$(echo "$msg" | sed -E "s/^[^ ]+ +Update ([^ ]+) to.*/\\1/")
latest=$(git log --oneline --all -E --grep="Update $dep to" --format=%H 2>/dev/null \
| head -1)
if [ "$COMMIT_SHA" != "$latest" ]; then printf "π"; else printf "%s" "$msg"; fi
'""" },
# Remove optional package prefix (e.g., "busd: ") but keep gimoji emojis.
# Matches emoji(s) at start, then "word(s): " prefix pattern.
{ pattern = "^([^\\p{L}\\p{N}\\s]+) [\\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.
{ 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
'""" },
]
# Categorize commits based on gimoji emojis.
# See: https://zeenix.github.io/gimoji/
commit_parsers = [
# 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 = "Added" },
{ message = "^π", group = "Added" },
{ message = "^π·", group = "Added" },
# Bug fixes.
{ message = "^π", group = "Fixed" },
{ message = "^π", group = "Fixed" },
{ message = "^π©Ή", group = "Fixed" },
{ message = "^π₯
", group = "Fixed" },
# Performance.
{ message = "^β‘", group = "Performance" },
# Documentation.
{ message = "^π", group = "Documentation" },
{ message = "^π‘", group = "Documentation" },
# Refactoring/changes.
{ message = "^β»οΈ", group = "Changed" },
{ message = "^π¨", group = "Changed" },
{ message = "^π", group = "Changed" },
{ message = "^π§", group = "Changed" },
{ message = "^ποΈ", group = "Changed" },
{ message = "^π", group = "Changed" },
# Breaking changes/removals.
{ message = "^π₯", group = "Breaking" },
{ message = "^π₯", group = "Removed" },
{ message = "^ποΈ", group = "Deprecated" },
# Dependencies.
{ message = "^β", group = "Dependencies" },
{ message = "^β", group = "Dependencies" },
{ message = "^π", group = "Dependencies" },
{ message = "^β¬οΈ", group = "Dependencies" },
{ message = "^β¬οΈ", group = "Dependencies" },
# Security.
{ message = "^π", group = "Security" },
# Testing.
{ message = "^β
", group = "Testing" },
{ message = "^π§ͺ", group = "Testing" },
# CI/Build.
{ message = "^π·", group = "CI" },
{ message = "^π", group = "CI" },
# Everything else.
{ message = ".*", group = "Other" },
]