File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1313 packages : write
1414 steps :
1515 - uses : actions/checkout@v3
16+ with :
17+ fetch-depth : 0 # This is important for getting all tags
1618
1719 - name : Setup Node.js
1820 uses : actions/setup-node@v3
@@ -40,11 +42,22 @@ jobs:
4042 echo "cjs_file=$CJS_FILE" >> $GITHUB_OUTPUT
4143 echo "esm_file=$ESM_FILE" >> $GITHUB_OUTPUT
4244 echo "types_file=$TYPES_FILE" >> $GITHUB_OUTPUT
45+
4346 - name : Publish to npm
4447 run : npm publish
4548 env :
4649 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
4750
51+ - name : Get Changelog Entry
52+ id : get_changelog
53+ run : |
54+ VERSION=${GITHUB_REF#refs/tags/}
55+ CHANGELOG_ENTRY=$(awk "/^## \[$VERSION\]/ {flag=1;next} /^## \[/ {flag=0} flag" CHANGELOG.md)
56+ CHANGELOG_ENTRY="${CHANGELOG_ENTRY//'%'/'%25'}"
57+ CHANGELOG_ENTRY="${CHANGELOG_ENTRY//$'\n'/'%0A'}"
58+ CHANGELOG_ENTRY="${CHANGELOG_ENTRY//$'\r'/'%0D'}"
59+ echo "changelog=$CHANGELOG_ENTRY" >> $GITHUB_OUTPUT
60+
4861 - name : Create Release
4962 id : create_release
5063 uses : actions/create-release@v1
5366 with :
5467 tag_name : ${{ github.ref }}
5568 release_name : Release ${{ github.ref }}
69+ body : |
70+ ${{ steps.get_changelog.outputs.changelog }}
5671 draft : false
5772 prerelease : false
5873
You can’t perform that action at this time.
0 commit comments