Commit 9de411a 1 parent f0df061 commit 9de411a Copy full SHA for 9de411a
File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 16
16
permissions :
17
17
id-token : write
18
18
contents : write
19
+ pull-requests : read
19
20
env :
21
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20
22
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
21
23
steps :
22
24
- uses : actions/checkout@v4
31
33
- run : |
32
34
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
33
35
git push origin v${{ fromJson(steps.pkg.outputs.json).version }}
36
+ - run : node scripts/release/notes
Original file line number Diff line number Diff line change 16
16
permissions :
17
17
id-token : write
18
18
contents : write
19
+ pull-requests : read
19
20
env :
21
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20
22
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
21
23
outputs :
22
24
pkgjson : ${{ steps.pkg.outputs.json }}
33
35
- run : |
34
36
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
35
37
git push origin v${{ fromJson(steps.pkg.outputs.json).version }}
38
+ - run : node scripts/release/notes --latest
36
39
37
40
docs :
38
41
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const fs = require ( 'fs' )
4
+ const os = require ( 'os' )
5
+ const path = require ( 'path' )
6
+ const { capture, success, run } = require ( './helpers/terminal' )
7
+ const pkg = require ( '../../package.json' )
8
+
9
+ const version = pkg . version
10
+ const tag = `v${ version } `
11
+ const major = version . split ( '.' ) [ 0 ]
12
+ const body = capture ( `gh pr view ${ tag } -proposal --json body --jq '.body'` )
13
+ const args = process . argv . slice ( 2 )
14
+ const flags = [ ]
15
+ const folder = path . join ( os . tmpdir ( ) , 'release_notes' )
16
+ const file = path . join ( folder , `${ tag } .md` )
17
+
18
+ if ( args . includes ( '--latest' ) ) {
19
+ flags . push ( '--latest' )
20
+ }
21
+
22
+ if ( version . includes ( '-' ) ) {
23
+ flags . push ( '--prerelease' )
24
+ }
25
+
26
+ fs . mkdirSync ( folder , { recursive : true } )
27
+ fs . writeFileSync ( file , body )
28
+
29
+ run ( `gh release create ${ tag } --target v${ major } .x --title ${ version } -F ${ file } ${ flags . join ( ' ' ) } ` )
30
+
31
+ success ( `Release notes published for ${ version } .` )
You can’t perform that action at this time.
0 commit comments