Skip to content

Commit ebb2c1d

Browse files
committed
feat: Adding CI/CD
1 parent 73306f4 commit ebb2c1d

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

.github/workflows/main.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: PasIRCLogBot
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
8+
push:
9+
branches: [ main ]
10+
tags: [ "*" ]
11+
paths-ignore: [ "README.md", "LICENSE", "CHANGELOG.md", "cliff.toml" ]
12+
13+
pull_request:
14+
branches: [ main ]
15+
16+
jobs:
17+
18+
build:
19+
name: 01 - Build Application
20+
uses: gcarreno/re-usable-workflows/.github/workflows/build.lazarus.yml@main
21+
with:
22+
config: '{
23+
"app-name": "paslogbot",
24+
"lpi-path": "src",
25+
"bin-path": "bin",
26+
"build-mode": "Release",
27+
"lazarus-packages": "",
28+
"matrix": {
29+
"os": [
30+
"ubuntu-latest",
31+
"windows-latest",
32+
"macos-latest"
33+
],
34+
"include":[
35+
{
36+
"os": "ubuntu-latest",
37+
"triplet": "x86_64-linux"
38+
},
39+
{
40+
"os": "windows-latest",
41+
"triplet": "x86_64-win64"
42+
},
43+
{
44+
"os": "macos-latest",
45+
"triplet": "x86_64-darwin"
46+
}
47+
],
48+
"lazarus-versions": [
49+
"stable",
50+
"3.4"
51+
]
52+
}
53+
}'
54+
fail-fast: false
55+
56+
release:
57+
if: contains(github.ref_type, 'tag')
58+
59+
name: 02 - Create GitHub Release
60+
uses: gcarreno/re-usable-workflows/.github/workflows/release.lazarus.yml@main
61+
needs: [ build]
62+
with:
63+
config: '{
64+
"app-name": "paslogbot",
65+
"tag": "${{ github.ref_name }}",
66+
"cliff-cfg": "cliff.toml",
67+
"win": "${{ needs.build.outputs.win-artefact-path }}",
68+
"lin": "${{ needs.build.outputs.lin-artefact-path }}",
69+
"osx": "${{ needs.build.outputs.osx-artefact-path }}"
70+
}'
71+
fail-fast: false

cliff.toml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[changelog]
9+
# changelog header
10+
header = """
11+
# Release Notes\n
12+
Notable changes up to the last release.\n
13+
<!-- generated by git-cliff -->\n
14+
"""
15+
# template for the changelog body
16+
# https://tera.netlify.app/docs
17+
body = """
18+
{% if version %}\
19+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
20+
{% else %}\
21+
## [unreleased]
22+
{% endif %}\
23+
{% for group, commits in commits | group_by(attribute="group") %}
24+
### {{ group | upper_first }}
25+
{% for commit in commits %}
26+
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
27+
{% endfor %}
28+
{% endfor %}\n
29+
"""
30+
# remove the leading and trailing whitespace from the template
31+
trim = true
32+
# changelog footer
33+
footer = """
34+
For a list of all the changes up to date, please read [CHANGELOG.md](https://github.com/ObjectPascal-Community/pasirclogbot/blob/main/CHANGELOG.md).
35+
<!-- generated by git-cliff -->
36+
"""
37+
# postprocessors
38+
postprocessors = [
39+
# { pattern = '<REPO>', replace = "https://github.com/ObjectPascal-Community/pasirclogbot" }, # replace repository URL
40+
]
41+
[git]
42+
# parse the commits based on https://www.conventionalcommits.org
43+
conventional_commits = true
44+
# filter out the commits that are not conventional
45+
filter_unconventional = true
46+
# process each line of a commit as an individual commit
47+
split_commits = false
48+
# regex for preprocessing the commit messages
49+
commit_preprocessors = [
50+
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers
51+
]
52+
# regex for parsing and grouping commits
53+
commit_parsers = [
54+
{ message = "^feat", group = "Features" },
55+
{ message = "^fix", group = "Bug Fixes" },
56+
{ message = "^doc", group = "Documentation" },
57+
{ message = "^perf", group = "Performance" },
58+
{ message = "^refactor", group = "Refactor" },
59+
{ message = "^style", group = "Styling" },
60+
{ message = "^test", group = "Testing" },
61+
{ message = "^chore\\(release\\): prepare for", skip = true },
62+
{ message = "^chore\\(deps\\)", skip = true },
63+
{ message = "^chore\\(pr\\)", skip = true },
64+
{ message = "^chore\\(pull\\)", skip = true },
65+
{ message = "^ign", skip = true},
66+
{ message = "^chore|ci", group = "Miscellaneous Tasks" },
67+
{ body = ".*security", group = "Security" },
68+
{ message = "^revert", group = "Revert" },
69+
]
70+
# protect breaking changes from being skipped due to matching a skipping commit_parser
71+
protect_breaking_commits = false
72+
# filter out the commits that are not matched by commit parsers
73+
filter_commits = false
74+
# glob pattern for matching git tags
75+
tag_pattern = "v[0-9]*"
76+
# regex for skipping tags
77+
skip_tags = "v0.1.0-beta.1"
78+
# regex for ignoring tags
79+
ignore_tags = ""
80+
# sort the tags topologically
81+
topo_order = false
82+
# sort the commits inside sections by oldest/newest order
83+
sort_commits = "oldest"
84+
# limit the number of commits included in the changelog.
85+
# limit_commits = 42

0 commit comments

Comments
 (0)