44 push :
55 branches :
66 - main
7- paths :
8- - ' CHANGELOG.md'
7+ # paths:
8+ # - 'CHANGELOG.md'
99
1010jobs :
1111 create-release :
@@ -22,66 +22,10 @@ jobs:
2222 - name : Parse Changelog
2323 id : changelog
2424 run : |
25- # Extract the latest version and its content from CHANGELOG.md
26- python3 << 'EOF'
27- import re
28- import sys
29-
30- with open('CHANGELOG.md', 'r') as f:
31- content = f.read()
32-
33- # Match version headers like ## [0.3.1] - 2026-02-10
34- version_pattern = r'^## \[([^\]]+)\] - (\d{4}-\d{2}-\d{2})'
35- matches = list(re.finditer(version_pattern, content, re.MULTILINE))
36-
37- if not matches:
38- print("No version found in CHANGELOG.md", file=sys.stderr)
39- sys.exit(1)
40-
41- # Get the first (latest) version
42- first_match = matches[0]
43- version = first_match.group(1)
44- date = first_match.group(2)
45-
46- # Extract content between first and second version headers
47- start_pos = first_match.end()
48- if len(matches) > 1:
49- end_pos = matches[1].start()
50- body = content[start_pos:end_pos].strip()
51- else:
52- # If only one version, get everything after it until the end or separator
53- remaining = content[start_pos:]
54- separator_match = re.search(r'^---$', remaining, re.MULTILINE)
55- if separator_match:
56- body = remaining[:separator_match.start()].strip()
57- else:
58- body = remaining.strip()
59-
60- # Clean up the body - remove leading/trailing whitespace
61- body = body.strip()
62-
63- # Write outputs
64- with open('version.txt', 'w') as f:
65- f.write(version)
66- with open('body.txt', 'w') as f:
67- f.write(body)
68-
69- print(f"Version: {version}")
70- print(f"Date: {date}")
71- print(f"Body length: {len(body)} characters")
72- EOF
73-
74- # Set outputs
75- VERSION=$(cat version.txt)
76- echo "version=$VERSION" >> $GITHUB_OUTPUT
77- echo "tag=v$VERSION" >> $GITHUB_OUTPUT
78-
79- # For multiline output, use delimiter
80- {
81- echo 'body<<EOF_CHANGELOG'
82- cat body.txt
83- echo EOF_CHANGELOG
84- } >> $GITHUB_OUTPUT
25+ RESULT=$(python3 .github/scripts/parse_changelog.py)
26+ echo "version=$(echo "$RESULT" | jq -r '.version')" >> $GITHUB_OUTPUT
27+ echo "tag=$(echo "$RESULT" | jq -r '.tag')" >> $GITHUB_OUTPUT
28+ echo "body=$(echo "$RESULT" | jq -r '.body')" >> $GITHUB_OUTPUT
8529
8630 - name : Check if release exists
8731 id : check_release
9034 run : |
9135 TAG="${{ steps.changelog.outputs.tag }}"
9236
93- # Check if release exists
9437 if gh release view "$TAG" &>/dev/null; then
9538 echo "Release $TAG already exists"
9639 echo "exists=true" >> $GITHUB_OUTPUT
@@ -106,11 +49,11 @@ jobs:
10649 run : |
10750 TAG="${{ steps.changelog.outputs.tag }}"
10851 VERSION="${{ steps.changelog.outputs.version }}"
52+ BODY="${{ steps.changelog.outputs.body }}"
10953
110- # Create release with changelog body
11154 gh release create "$TAG" \
11255 --title "Release $VERSION" \
113- --notes "${{ steps.changelog.outputs.body }} " \
56+ --notes "$BODY " \
11457 --verify-tag
11558
11659 - name : Skip Release
0 commit comments