Skip to content

Commit f976ac6

Browse files
committed
feat(changelog): add configuration for changelog generation
- Introduce changelog configuration file for structured changelog entries. - Update GitHub Actions workflow to utilize the new changelog configuration. - Enhance changelog with new entries for version 0.3.0.
1 parent eb2d247 commit f976ac6

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

.github/changelog-config.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🚀 Features",
5+
"labels": ["feature", "enhancement"]
6+
},
7+
{
8+
"title": "## 🐛 Fixes",
9+
"labels": ["fix", "bugfix", "bug"]
10+
},
11+
{
12+
"title": "## 🔒 Security",
13+
"labels": ["security"]
14+
},
15+
{
16+
"title": "## 📝 Documentation",
17+
"labels": ["documentation", "docs"]
18+
},
19+
{
20+
"title": "## 🧰 Maintenance",
21+
"labels": ["chore", "dependencies"]
22+
}
23+
],
24+
"template": "${{CHANGELOG}}",
25+
"pr_template": "- ${{TITLE}} (#${{NUMBER}})",
26+
"empty_template": "- No changes",
27+
"label_extractor": [
28+
{
29+
"pattern": "^(feat|feature)(\\(.+\\))?:",
30+
"target": "feature"
31+
},
32+
{
33+
"pattern": "^(fix|bugfix)(\\(.+\\))?:",
34+
"target": "fix"
35+
},
36+
{
37+
"pattern": "^(docs|doc)(\\(.+\\))?:",
38+
"target": "documentation"
39+
},
40+
{
41+
"pattern": "^(chore|refactor)(\\(.+\\))?:",
42+
"target": "chore"
43+
}
44+
]
45+
}

.github/workflows/publish.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@ jobs:
2828
- name: Build package
2929
run: python -m build
3030

31-
- name: Extract changelog
31+
- name: Build Changelog
3232
id: changelog
33-
run: |
34-
VERSION=${GITHUB_REF#refs/tags/v}
35-
CHANGELOG=$(awk '/^## \['"$VERSION"'\]/,/^## \[/{if (/^## \[/ && !/^## \['"$VERSION"'\]/) exit; if (!/^## \['"$VERSION"'\]/) print}' CHANGELOG.md)
36-
echo "content<<EOF" >> $GITHUB_OUTPUT
37-
echo "$CHANGELOG" >> $GITHUB_OUTPUT
38-
echo "EOF" >> $GITHUB_OUTPUT
33+
uses: mikepenz/release-changelog-builder-action@v4
34+
with:
35+
configuration: ".github/changelog-config.json"
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3938

4039
- name: Create Release
4140
uses: softprops/action-gh-release@v1
4241
with:
43-
body: ${{ steps.changelog.outputs.content }}
42+
body: ${{ steps.changelog.outputs.changelog }}
4443
generate_release_notes: false
4544

4645
- name: Publish to PyPI

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.0] - 2025-01-28
11+
12+
### Added
13+
- Enhanced GitHub release workflow with improved changelog extraction
14+
- Better error handling in CI/CD pipeline
15+
16+
### Fixed
17+
- Changelog parsing in release notes generation
18+
1019
## [0.2.1] - 2025-01-27
1120

1221
### Fixed

0 commit comments

Comments
 (0)