Skip to content

Commit b1bcc3d

Browse files
ci: automate github releases
1 parent 2a97566 commit b1bcc3d

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/cliff.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[changelog]
2+
header = ""
3+
body = """
4+
## Core
5+
6+
{% for commit in commits|filter(attribute="group", value = "core") %}
7+
- {{ commit.message }}
8+
{% else %}
9+
N/A
10+
{% endfor %}
11+
12+
## Serialization
13+
14+
{% for commit in commits|filter(attribute="group", value = "serialization") %}
15+
- {{ commit.message }}
16+
{% else %}
17+
N/A
18+
{% endfor %}
19+
20+
## Misc
21+
22+
{% for commit in commits|filter(attribute="group", value = "misc") %}
23+
- {{ commit.message }}
24+
{% else %}
25+
N/A
26+
{% endfor %}
27+
"""
28+
footer = ""
29+
trim = true
30+
postprocessors = [
31+
{ pattern = "\\(core\\)", replace = "" },
32+
{ pattern = "\\(serialization\\)", replace = "" },
33+
{ pattern = "- ([a-z()]+!?:)", replace = "- **$1**" }
34+
]
35+
36+
[git]
37+
conventional_commits = false
38+
39+
[[git.commit_parsers]]
40+
message = "^[a-z]+\\(core\\)!?:"
41+
group = "core"
42+
43+
[[git.commit_parsers]]
44+
message = "^[a-z]+\\(serialization\\)!?:"
45+
group = "serialization"
46+
47+
[[git.commit_parsers]]
48+
message = "^ci|^chore: release"
49+
skip = true
50+
51+
[[git.commit_parsers]]
52+
message = ".+"
53+
group = "misc"

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,26 @@ jobs:
126126
fi
127127
- name: Publish deployment
128128
run: curl -fi -XPOST -H "$SONATYPE_AUTH" "$SONATYPE_API/deployment/$DEPLOYMENT_ID"
129+
release:
130+
runs-on: ubuntu-latest
131+
name: Create GitHub release
132+
needs: [publish]
133+
steps:
134+
- name: Checkout repository
135+
uses: actions/checkout@v4
136+
with:
137+
fetch-depth: 0
138+
- name: Generate changelog
139+
uses: orhun/git-cliff-action@v3
140+
with:
141+
args: -v --current
142+
config: .github/cliff.toml
143+
env:
144+
GITHUB_TOKEN: ${{github.token}}
145+
GITHUB_REPO: ${{github.repository}}
146+
OUTPUT: ${{runner.temp}}/changes.md
147+
- name: Create release
148+
run: gh release create $GITHUB_REF_NAME -F $RUNNER_TEMP/changes.md
149+
env:
150+
GH_TOKEN: ${{github.token}}
151+

0 commit comments

Comments
 (0)