File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,17 +41,30 @@ jobs:
4141 echo "VERSION=$VERSION" >> $GITHUB_ENV # Save version as environment variable
4242 shell : bash
4343
44+ - name : Extract changelog for version
45+ id : extract_changelog
46+ run : |
47+ VERSION_NUMBER=${VERSION#v} # Remove 'v' prefix for matching
48+ # Extract changelog section between this version and next version header
49+ CHANGELOG=$(awk "/^## \[${VERSION_NUMBER}\]/{flag=1; next} /^## \[|^### Changelog/{if(flag) exit} flag" CHANGELOG.md)
50+ # Handle multiline content for GitHub Actions
51+ echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
52+ echo "$CHANGELOG" >> $GITHUB_ENV
53+ echo "EOF" >> $GITHUB_ENV
54+ shell : bash
55+
4456 - name : Publish to npm
4557 env :
4658 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
4759 run : npm publish --tag latest
4860
4961 - name : Create GitHub Release
50- uses : actions/create- release@v1
62+ uses : softprops/action-gh- release@v2
5163 env :
5264 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5365 with :
54- tag_name : ${{ env.VERSION }} # Use the extracted version
55- release_name : ${{ env.VERSION }} # Use the extracted version
66+ tag_name : ${{ env.VERSION }}
67+ name : ${{ env.VERSION }}
68+ body : ${{ env.RELEASE_BODY }}
5669 draft : false
5770 prerelease : false
You can’t perform that action at this time.
0 commit comments