File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 13
13
packages : write
14
14
steps :
15
15
- uses : actions/checkout@v3
16
+ with :
17
+ fetch-depth : 0 # This is important for getting all tags
16
18
17
19
- name : Setup Node.js
18
20
uses : actions/setup-node@v3
@@ -40,11 +42,22 @@ jobs:
40
42
echo "cjs_file=$CJS_FILE" >> $GITHUB_OUTPUT
41
43
echo "esm_file=$ESM_FILE" >> $GITHUB_OUTPUT
42
44
echo "types_file=$TYPES_FILE" >> $GITHUB_OUTPUT
45
+
43
46
- name : Publish to npm
44
47
run : npm publish
45
48
env :
46
49
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
47
50
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
+
48
61
- name : Create Release
49
62
id : create_release
50
63
uses : actions/create-release@v1
53
66
with :
54
67
tag_name : ${{ github.ref }}
55
68
release_name : Release ${{ github.ref }}
69
+ body : |
70
+ ${{ steps.get_changelog.outputs.changelog }}
56
71
draft : false
57
72
prerelease : false
58
73
You can’t perform that action at this time.
0 commit comments