@@ -33,15 +33,37 @@ jobs:
33
33
run : npm run release -- --commit-all # standard-version determines version based on commits
34
34
# Add --first-release if this is the absolute first tag/release
35
35
36
+ - name : Get version from package.json
37
+ id : package-version
38
+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
39
+
40
+ - name : Extract changelog content
41
+ id : changelog
42
+ run : |
43
+ VERSION=$(node -p "require('./package.json').version")
44
+ CHANGELOG_CONTENT=$(awk "/### \[$VERSION\]/,/### \[.*\]/ { if (!/### \[.*\]/ || NR==1) print; }" CHANGELOG.md | sed '1d;$d')
45
+ echo "content<<EOF" >> $GITHUB_OUTPUT
46
+ echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT
47
+ echo "EOF" >> $GITHUB_OUTPUT
48
+
36
49
- name : Push changes and tags
37
50
run : git push --follow-tags origin main
38
51
# Ensure this pushes to the correct branch (e.g., main)
39
52
40
53
- name : Create GitHub Release
41
54
uses : softprops/action-gh-release@v1
42
55
# This action runs implicitly on tag push, which is handled by the previous step.
43
- # If you want more control, you can extract the tag version and trigger explicitly.
44
56
env :
45
57
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
58
with :
47
- generate_release_notes : true # Use conventional commits for release notes
59
+ tag_name : v${{ steps.package-version.outputs.version }}
60
+ name : Release v${{ steps.package-version.outputs.version }}
61
+ body : |
62
+ ## Release Notes
63
+
64
+ ${{ steps.changelog.outputs.content }}
65
+
66
+ ## Changes
67
+
68
+ See the [CHANGELOG.md](./CHANGELOG.md) for all changes and the complete history.
69
+ generate_release_notes : true # Will append GitHub's generated notes
0 commit comments