File tree Expand file tree Collapse file tree 3 files changed +23
-605
lines changed Expand file tree Collapse file tree 3 files changed +23
-605
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-slack-bot"
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
+
13
+ try {
14
+ const results = await replace ( options ) ;
15
+ console . log ( 'Replacement results:' , results ) ;
16
+ } catch ( error ) {
17
+ console . error ( 'Error occurred:' , error ) ;
18
+ }
19
+ }
20
+
21
+ updateChangelog ( ) ;
You can’t perform that action at this time.
0 commit comments