Skip to content

Commit 2c79e5a

Browse files
committed
ci: add configuration and details to build release note
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent e1f7590 commit 2c79e5a

File tree

2 files changed

+93
-1
lines changed

2 files changed

+93
-1
lines changed

.github/DEVELOP.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,20 @@ Tokens library v0.4.1
320320

321321
We try also to apply [keep a changelog](https://keepachangelog.com/en/1.0.0/), and [semantic versioning](https://semver.org/spec/v2.0.0.html) both with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
322322

323-
We do not generate yet `RELEASE_NOTE.md` file using the Git history and [git cliff](https://git-cliff.org/) tool.
323+
We can generate a `RELEASE_NOTE.md` file using the Git history and [git cliff](https://git-cliff.org/) tool.
324324
Today we update the unique CHANGELOG manualy, but you can find [in the wiki more details about the use of git-cliff](https://github.com/Orange-OpenSource/ouds-ios/wiki/52-%E2%80%90-About-changelog,-release-notes-and-hooks)
325325

326+
To generate a release note:
327+
328+
```shell
329+
# Install git-cliff
330+
brew install git-cliff
331+
332+
# Run the command
333+
# where X is the starting tag and Y the ending tag
334+
git-cliff --config .github/cliff.toml --output RELEASE_NOTE.md X..Y
335+
```
336+
326337
## Use of Gitleaks
327338

328339
[Gitleaks](https://gitleaks.io/) can be used to check if secrets can be leaked or not.

.github/cliff.toml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#
2+
# Software Name: OUDS iOS
3+
# SPDX-FileCopyrightText: Copyright (c) Orange SA
4+
# SPDX-License-Identifier: MIT
5+
#
6+
# This software is distributed under the MIT license,
7+
# the text of which is available at https://opensource.org/license/MIT/
8+
# or see the "LICENSE" file for more details.
9+
#
10+
# Authors: See CONTRIBUTORS.txt
11+
# Software description: A SwiftUI components library with code examples for Orange Unified Design System
12+
#
13+
14+
# git-cliff ~ configuration file
15+
# https://git-cliff.org/docs/configuration
16+
17+
[changelog]
18+
# changelog header
19+
header = """
20+
# What's new\n
21+
```
22+
🧱 Tokens version: v.
23+
```
24+
"""
25+
# template for the changelog body
26+
# https://keats.github.io/tera/docs/#introduction
27+
body = """
28+
{% for group, commits in commits | group_by(attribute="group") %}
29+
## {{ group | upper_first }}
30+
{% for commit in commits %}
31+
- {{ commit.message | upper_first }} ({{ commit.id }})\
32+
{% endfor %}
33+
{% endfor %}\n
34+
"""
35+
# remove the leading and trailing whitespace from the templates
36+
trim = true
37+
38+
[git]
39+
# parse the commits based on https://www.conventionalcommits.org
40+
conventional_commits = true
41+
# filter out the commits that are not conventional
42+
filter_unconventional = true
43+
# process each line of a commit as an individual commit
44+
split_commits = false
45+
# regex for parsing and grouping commits
46+
commit_parsers = [
47+
{ message = "^feat:", group = "🚀 Features" },
48+
{ message = "^fix:", group = "🐛 Fixes" },
49+
{ message = "^docs:", group = "📖 Docs" },
50+
{ message = "^chore:", group = "🧰 Chore" },
51+
{ message = "^refactor:", group = "🧰 Chore" },
52+
{ message = "^style:", group = "🧰 Chore" },
53+
{ message = "^test:", group = "🧰 Chore" },
54+
{ message = "^ci:", group = "🧰 Chore" },
55+
{ message = "^feat!:", group = "💥 Breaking changes" },
56+
{ message = "^fix!:", group = "💥 Breaking changes" },
57+
{ message = "^docs!:", group = "💥 Breaking changes" },
58+
{ message = "^chore!:", group = "💥 Breaking changes" },
59+
{ message = "^refactor!:", group = "💥 Breaking changes" },
60+
{ message = "^style!:", group = "💥 Breaking changes" },
61+
{ message = "^test!:", group = "💥 Breaking changes" },
62+
{ message = "^ci!:", group = "💥 Breaking changes" },
63+
{ message = "^.*", group = "🧰 Chore" },
64+
]
65+
commit_preprocessors = [
66+
{ pattern = '.*', replace_command = 'git show -s --format=%B $COMMIT_SHA' }
67+
]
68+
# protect breaking changes from being skipped due to matching a skipping commit_parser
69+
protect_breaking_commits = false
70+
# filter out the commits that are not matched by commit parsers
71+
filter_commits = true
72+
# regex for matching git tags
73+
tag_pattern = "v[0-9].*"
74+
# regex for skipping tags
75+
skip_tags = "v0.1.0-beta.1"
76+
# regex for ignoring tags
77+
ignore_tags = ""
78+
# sort the tags topologically
79+
topo_order = false
80+
# sort the commits inside sections by oldest/newest order
81+
sort_commits = "newest"

0 commit comments

Comments
 (0)