File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *.*.*' # Trigger on version tags like v1.0.0
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+
17+ - name : Extract Release Notes
18+ id : extract_notes
19+ run : |
20+ VERSION="${GITHUB_REF#refs/tags/}"
21+
22+ # Use awk to extract content between the target version and the next header
23+ # - matches "## [VERSION]" (even if it has a date like " - 2026-04-28")
24+ # - stops at the next "## ["
25+ awk -v ver="[$VERSION]" '/^## / { if (p) exit; if ($2 ~ ver) p=1; next } p' CHANGELOG.md > release_notes.md
26+
27+ # Check if notes were found
28+ if [ ! -s release_notes.md ]; then
29+ echo "No notes found for version $VERSION"
30+ echo "Release $VERSION" > release_notes.md
31+ fi
32+
33+ - name : Create Release
34+ uses : softprops/action-gh-release@v2
35+ with :
36+ body_path : release_notes.md
37+ draft : false
38+ prerelease : false
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 11* .pyc
22__pycache__
33.cache
4+ release_notes.md
You can’t perform that action at this time.
0 commit comments