Skip to content

Commit 01c1808

Browse files
committed
feat(ci): replace changelog action with custom extraction script
* Extract changelog directly from CHANGELOG.md * Generate release notes based on the current version tag * Simplify the release process by removing external dependencies
1 parent 59984aa commit 01c1808

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/publish.yml

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

31-
- name: Build Changelog
31+
- name: Extract changelog
3232
id: changelog
33-
uses: mikepenz/release-changelog-builder-action@v4
34-
with:
35-
configuration: ".github/changelog-config.json"
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
VERSION=${GITHUB_REF#refs/tags/v}
35+
sed -n "/^## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '1d;$d' > release_notes.txt
36+
if [ ! -s release_notes.txt ]; then
37+
echo "Release $VERSION" > release_notes.txt
38+
fi
39+
cat release_notes.txt
3840
3941
- name: Create Release
4042
uses: softprops/action-gh-release@v1
4143
with:
42-
body: ${{ steps.changelog.outputs.changelog }}
44+
body_path: release_notes.txt
4345
generate_release_notes: false
4446

4547
- name: Publish to PyPI

0 commit comments

Comments
 (0)