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 9
9
- - "@semantic-release/release-notes-generator"
10
10
- preset : simple-preset
11
11
- - "@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 '
13
13
- - "@semantic-release/exec"
14
14
- prepareCmd : grunt version::${nextRelease.version} && grunt wp_readme_to_markdown
15
15
- - "@semantic-release/git"
@@ -31,4 +31,4 @@ plugins:
31
31
- pattern : master
32
32
notifyOnSuccess : true
33
33
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