File tree Expand file tree Collapse file tree 3 files changed +23
-1075
lines changed Expand file tree Collapse file tree 3 files changed +23
-1075
lines changed Original file line number Diff line number Diff line change 99 - - "@semantic-release/release-notes-generator"
1010 - preset : simple-preset
1111 - - "@semantic-release/exec"
12- - prepareCmd : " replace-in-file \" == Changelog == \" \" == Changelog == \n\n ${nextRelease.notes}\" readme.txt "
12+ - prepareCmd : ' export nextReleaseNotes=" ${nextRelease.notes}" && node bin/update-changelog.js '
1313 - - "@semantic-release/exec"
1414 - prepareCmd : grunt version::${nextRelease.version} && grunt wp_readme_to_markdown
1515 - - "@semantic-release/git"
@@ -31,4 +31,4 @@ plugins:
3131 - pattern : master
3232 notifyOnSuccess : true
3333 notifyOnFail : false
34- - - "@semantic-release/github"
34+ - - "@semantic-release/github"
Original file line number Diff line number Diff line change 1+ const replace = require ( 'replace-in-file' ) ;
2+
3+ async function updateChangelog ( ) {
4+ const options = {
5+ files : 'readme.txt' ,
6+ from : / = = C h a n g e l o g = = [ \s \S ] * ?\[ S e e c h a n g e l o g f o r a l l v e r s i o n s \] / ,
7+ to : ( match ) => {
8+ return `== Changelog ==\n\n${ process . env . nextReleaseNotes } \n\n[See changelog for all versions]` ;
9+ } ,
10+ encoding : 'utf8' ,
11+ } ;
12+ try {
13+ const results = await replace ( options ) ;
14+ console . log ( 'Replacement results:' , results ) ;
15+ } catch ( error ) {
16+ console . error ( 'Error occurred:' , error ) ;
17+ }
18+ }
19+
20+ updateChangelog ( ) ;
You can’t perform that action at this time.
0 commit comments