Skip to content

Commit 8df001f

Browse files
committed
ci(release): 修复发布流水线分支推送和CHANGELOG配置
- 修复分支推送从 main 改为 src - 添加 cliff.toml 配置 CHANGELOG 生成规则
1 parent cb82ccb commit 8df001f

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Push changes
8888
if: steps.check.outputs.need_release == 'true'
8989
run: |
90-
git push origin main
90+
git push origin src
9191
git tag ${{ steps.version.outputs.version }}
9292
git push origin ${{ steps.version.outputs.version }}
9393

cliff.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Git Cliff Configuration
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# changelog header
6+
header = """
7+
# Changelog\n
8+
All notable changes to this project will be documented in this file.\n
9+
"""
10+
# template for the changelog body
11+
body = """
12+
{% if version %}\
13+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
14+
{% else %}\
15+
## [unreleased]
16+
{% endif %}\
17+
{% for commit in commits %}
18+
* {{ commit.message | split(pat="\n") | first | trim }}\
19+
{% endfor %}
20+
"""
21+
# remove the leading and trailing whitespace from the template
22+
trim = true
23+
# changelog footer
24+
footer = """
25+
<!-- generated by git-cliff -->
26+
"""
27+
28+
[git]
29+
# parse the commits based on https://www.conventionalcommits.org
30+
conventional_commits = true
31+
# filter out the commits that are not conventional
32+
filter_unconventional = true
33+
# process each line of a commit as an individual commit
34+
split_commits = false
35+
# regex for preprocessing the commit messages
36+
commit_preprocessors = [
37+
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
38+
]
39+
# regex for parsing and grouping commits
40+
commit_parsers = [
41+
{ message = "^feat", group = "Features" },
42+
{ message = "^fix", group = "Bug Fixes" },
43+
{ message = "^doc", group = "Documentation" },
44+
{ message = "^perf", group = "Performance" },
45+
{ message = "^refactor", group = "Refactor" },
46+
{ message = "^style", group = "Styling" },
47+
{ message = "^test", group = "Testing" },
48+
{ message = "^chore\\(release\\)", skip = true },
49+
{ message = "^chore", group = "Miscellaneous Tasks" },
50+
{ body = ".*security", group = "Security" },
51+
]
52+
# protect breaking changes from being skipped due to matching a skipping commit_parser
53+
protect_breaking_commits = false
54+
# filter out the commits that are not matched by commit parsers
55+
filter_commits = false
56+
# glob pattern for matching git tags
57+
tag_pattern = "[0-9]*"
58+
# regex for skipping tags
59+
skip_tags = "v?.*-rc.*"
60+
# regex for ignoring tags
61+
ignore_tags = ""
62+
# sort the tags topologically
63+
topo_order = false
64+
# sort the commits inside sections by oldest/newest order
65+
sort_commits = "oldest"

0 commit comments

Comments
 (0)