Skip to content

Commit 3770d33

Browse files
EstrellaXDclaude
andcommitted
chore: add beta release notes generator script
Generates concise release notes showing only changes between beta versions: - Auto-detects previous beta tag - Groups commits by type (feat, fix, perf, docs) - Excludes chore/refactor/test commits from notes - Includes link to full changelog comparison Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4e2a22a commit 3770d33

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

scripts/generate-beta-notes.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
# Generate release notes for beta versions
3+
# Usage: ./generate-beta-notes.sh <new-tag> [previous-tag]
4+
5+
set -e
6+
7+
NEW_TAG="${1:?Usage: $0 <new-tag> [previous-tag]}"
8+
REPO_URL="https://github.com/EstrellaXD/Auto_Bangumi"
9+
10+
# Auto-detect previous beta tag if not provided
11+
if [ -z "$2" ]; then
12+
PREV_TAG=$(git tag --sort=-v:refname | grep -E "^${NEW_TAG%-*}" | grep beta | head -2 | tail -1)
13+
else
14+
PREV_TAG="$2"
15+
fi
16+
17+
if [ -z "$PREV_TAG" ] || [ "$PREV_TAG" = "$NEW_TAG" ]; then
18+
echo "## Initial Beta Release"
19+
echo ""
20+
echo "First beta for this version series."
21+
exit 0
22+
fi
23+
24+
echo "## Changes since ${PREV_TAG#v}"
25+
echo ""
26+
27+
# Get commits and categorize
28+
FEATS=$(git log --oneline "$PREV_TAG..$NEW_TAG" --no-merges --grep="^feat" --format="- %s" 2>/dev/null || true)
29+
FIXES=$(git log --oneline "$PREV_TAG..$NEW_TAG" --no-merges --grep="^fix" --format="- %s" 2>/dev/null || true)
30+
PERFS=$(git log --oneline "$PREV_TAG..$NEW_TAG" --no-merges --grep="^perf" --format="- %s" 2>/dev/null || true)
31+
DOCS=$(git log --oneline "$PREV_TAG..$NEW_TAG" --no-merges --grep="^docs" --format="- %s" 2>/dev/null || true)
32+
OTHERS=$(git log --oneline "$PREV_TAG..$NEW_TAG" --no-merges --grep="^chore\|^refactor\|^test\|^ci" --format="- %s" 2>/dev/null || true)
33+
34+
if [ -n "$FEATS" ]; then
35+
echo "### Features"
36+
echo "$FEATS"
37+
echo ""
38+
fi
39+
40+
if [ -n "$FIXES" ]; then
41+
echo "### Fixes"
42+
echo "$FIXES"
43+
echo ""
44+
fi
45+
46+
if [ -n "$PERFS" ]; then
47+
echo "### Performance"
48+
echo "$PERFS"
49+
echo ""
50+
fi
51+
52+
if [ -n "$DOCS" ]; then
53+
echo "### Documentation"
54+
echo "$DOCS"
55+
echo ""
56+
fi
57+
58+
# Don't show chore/refactor/test in release notes (too noisy)
59+
60+
echo "---"
61+
echo "**Full Changelog**: ${REPO_URL}/compare/${PREV_TAG}...${NEW_TAG}"

0 commit comments

Comments
 (0)