Skip to content

Commit dceffcd

Browse files
author
LeanBitLab
committed
ci: flatten and simplify release notes formatting
1 parent 0d885cc commit dceffcd

1 file changed

Lines changed: 14 additions & 57 deletions

File tree

.github/scripts/generate_release_notes.py

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,84 +9,41 @@ def run_cmd(cmd):
99

1010
def main():
1111
tag_name = os.environ.get("TAG_NAME", "v-dev")
12-
commit_sha = run_cmd(["git", "rev-parse", "--short", "HEAD"])
1312

14-
# Get previous tag
15-
prev_tag = run_cmd(["git", "describe", "--tags", "--abbrev=0", "HEAD^"])
13+
# Get previous tag matching v*
14+
prev_tag = run_cmd(["git", "describe", "--tags", "--match=v*", "--abbrev=0", "HEAD^"])
1615
log_range = f"{prev_tag}..HEAD" if prev_tag else "HEAD"
1716

1817
# Get commits
1918
commits_raw = run_cmd(["git", "log", log_range, "--pretty=format:%s"])
2019
raw_list = [c.strip() for c in commits_raw.split("\n") if c.strip()] if commits_raw else []
2120

22-
# Filter commits
21+
# Filter commits (keep only conventional app changes)
2322
commits = []
23+
allowed_prefixes = ("feat:", "fix:", "refactor:", "perf:")
24+
ignored_keywords = ("gitignore", "badge", "workflow", "readme", "fleet")
2425
for c in raw_list:
2526
c_lower = c.lower()
26-
if "leanbitlab/jules" in c_lower or "jules" in c_lower:
27-
continue
28-
if c_lower.startswith("chore: update daily downloads and stars badges"):
29-
continue
30-
commits.append(c)
31-
32-
# Categorized lists
33-
customization = []
34-
behavior = []
35-
performance = []
36-
under_the_hood = []
37-
38-
for commit in commits:
39-
commit_lower = commit.lower()
40-
if any(x in commit_lower for x in ["theme", "color", "appearance", "style", "font", "preset", "outline", "transparency", "opacity"]):
41-
customization.append(commit)
42-
elif any(x in commit_lower for x in ["layout", "click", "action", "alarm", "clock", "calendar", "tasks", "steps", "battery", "temp", "weather", "data", "storage", "ram", "screen_time"]):
43-
behavior.append(commit)
44-
elif any(x in commit_lower for x in ["perf", "optimize", "cache", "speed", "fast"]):
45-
performance.append(commit)
46-
else:
47-
under_the_hood.append(commit)
27+
if c_lower.startswith(allowed_prefixes):
28+
if "jules" in c_lower:
29+
continue
30+
if any(kw in c_lower for kw in ignored_keywords):
31+
continue
32+
commits.append(c)
4833

4934
# Build release notes markdown
5035
lines = []
5136
lines.append(f"## {tag_name}")
5237
lines.append("")
53-
54-
lines.append("💖 **Support Our Work**")
55-
lines.append("We are committed to making our apps as powerful and polished as possible. As an entirely community-funded project, we rely on your support to keep going, please consider becoming a [sponsor](https://github.com/sponsors/LeanBitLab). A huge thank you to all our current supporters!")
56-
lines.append("")
57-
5838
lines.append("🚀 **What's New**")
5939
lines.append("")
6040

61-
if customization:
62-
lines.append("🎨 **Customization & Appearance**")
63-
for c in customization:
64-
lines.append(f"- {c}")
65-
lines.append("")
41+
for c in commits:
42+
lines.append(f"- {c}")
6643

67-
if behavior:
68-
lines.append("⌨️ **Layouts & Keyboard Behavior**")
69-
for c in behavior:
70-
lines.append(f"- {c}")
71-
lines.append("")
72-
73-
if performance:
74-
lines.append("⚡ **Performance & Spellchecking**")
75-
for c in performance:
76-
lines.append(f"- {c}")
77-
lines.append("")
78-
79-
if under_the_hood:
80-
lines.append("⚙️ **Under the Hood**")
81-
for c in under_the_hood:
82-
lines.append(f"- {c}")
83-
lines.append("")
84-
85-
lines.append("📦 **Downloads**")
86-
8744
# Ensure file is written correctly
8845
with open("release_notes.md", "w") as f:
89-
f.write("\n".join(lines))
46+
f.write("\n".join(lines).strip() + "\n")
9047

9148
if __name__ == "__main__":
9249
main()

0 commit comments

Comments
 (0)