1- name : ' Make github and npm releases'
1+ name : ' Create github and npm releases'
22
33on :
44 push :
99 make-release :
1010 name : ' Make github and npm releases'
1111 runs-on : ubuntu-latest
12+ permissions :
13+ contents : write
1214
1315 steps :
1416 - name : ' Checkout source code'
1517 uses : ' actions/checkout@v4'
1618 - name : ' Setup node'
1719 uses : actions/setup-node@v4
1820 with :
19- node-version : ' 18 .x'
21+ node-version : ' 20 .x'
2022 registry-url : ' https://registry.npmjs.org'
2123 scope : ' @dtrw'
2224 - name : ' Install dependencies'
@@ -31,11 +33,15 @@ jobs:
3133 run : " yarn publish --tag ${{ ((contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta')) && 'next') || 'latest' }} --access public"
3234 env :
3335 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
36+ - name : Generate Changelog
37+ run : |
38+ START=$(grep -n "## \[" CHANGELOG.md | head -n 1 | cut -d : -f 1)
39+ END=$(grep -n "## \[" CHANGELOG.md | head -n 2 | tail -n 1 | cut -d : -f 1)
40+ awk "NR > $START && NR < $END" CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' > ${{ github.workspace }}-CHANGELOG.temp.md
3441 - name : ' Create a github release'
35- uses : " marvinpinto/action-automatic-releases@latest"
36- # TODO: https://github.com/marvinpinto/actions/pull/642
37- # TODO: body/content
42+ uses : softprops/action-gh-release@v2
3843 with :
39- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
44+ token : " ${{ secrets.GITHUB_TOKEN }}"
4045 prerelease : ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') }}
41- automatic_release_tag : " ${{ github.ref_name }}"
46+ tag_name : " ${{ github.ref_name }}"
47+ body_path : ${{ github.workspace }}-CHANGELOG.temp.md
0 commit comments