File tree Expand file tree Collapse file tree 6 files changed +65
-4
lines changed Expand file tree Collapse file tree 6 files changed +65
-4
lines changed Original file line number Diff line number Diff line change 3636 "ts": "never",
3737 }
3838 ]
39- }
39+ },
40+ "overrides": [
41+ {
42+ "files": ["scripts/*.js"],
43+ "env": { "node": true },
44+ "rules": {
45+ "@typescript-eslint/no-var-requires": ["off"],
46+ "no-console": ["off"]
47+ }
48+ }
49+ ]
4050}
Original file line number Diff line number Diff line change 1+ name : Create release
2+ on :
3+ push :
4+ tags :
5+ - ' v*'
6+
7+ jobs :
8+ release :
9+ name : Create release
10+ runs-on : ubuntu-18.04
11+
12+ steps :
13+ - name : Checkout repo
14+ uses : actions/checkout@master
15+ - name : Setup Node.js version
16+ uses : actions/setup-node@master
17+ with :
18+ node-version : ' 12.16.1'
19+
20+ - name : Generate release body
21+ run : |
22+ yarn extract-latest-change-log
23+ - name : Create release
24+ id : create-release
25+ uses : actions/create-release@v1
26+ env :
27+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28+ with :
29+ tag_name : ${{ github.ref }}
30+ release_name : ${{ github.ref }}
31+ draft : false
32+ prerelease : false
33+ body_path : RELEASE_BODY.md
Original file line number Diff line number Diff line change 1+ {
2+ "header": "# Changelog\n"
3+ }
Original file line number Diff line number Diff line change 11# Changelog
22
3- All notable changes to this project will be documented in this file. See [ standard-version] ( https://github.com/conventional-changelog/standard-version ) for commit guidelines.
4-
53### [ 1.0.1] ( https://github.com/icelam/html-inline-script-webpack-plugin/compare/v1.0.0...v1.0.1 ) (2021-01-22)
64
75
Original file line number Diff line number Diff line change 88 "lint" : " eslint --ext .ts,js src" ,
99 "prepare" : " install-peers" ,
1010 "first-release" : " npx standard-version --commit-all --tag-prefix v --first-release" ,
11- "release" : " npx standard-version --commit-all --tag-prefix v"
11+ "release" : " npx standard-version --commit-all --tag-prefix v" ,
12+ "extract-latest-change-log" : " node scripts/extractLatestChangeLog.js"
1213 },
1314 "author" : " Ice Lam" ,
1415 "repository" : {
Original file line number Diff line number Diff line change 1+ const fs = require ( 'fs' ) . promises ;
2+ const path = require ( 'path' ) ;
3+
4+ const BASE_DIR = path . join ( __dirname , '..' ) ;
5+ const CHANGELOG_PATH = path . join ( BASE_DIR , 'CHANGELOG.md' ) ;
6+ const RELEASE_BODY_PATH = path . join ( BASE_DIR , 'RELEASE_BODY.md' ) ;
7+
8+ ( async ( ) => {
9+ try {
10+ const file = await fs . readFile ( CHANGELOG_PATH , 'utf8' ) ;
11+ const updated = / ( # + \[ \d + \. \d + \. \d + ] .* ?) # + \[ ? \d + \. \d + \. \d + ] ?/ s. exec ( file ) ;
12+ await fs . writeFile ( RELEASE_BODY_PATH , updated [ 1 ] ) ;
13+ } catch ( error ) {
14+ console . error ( error ) ;
15+ }
16+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments