@@ -16,12 +16,30 @@ const versionFileUpdater = {
16
16
const [ major , minor , patch ] = [ splitted [ 0 ] , splitted [ 1 ] , splitted [ 2 ] ] ;
17
17
18
18
return contents
19
- . replace ( this . MAJOR_REGEX . exec ( contents ) [ 0 ] , `versionMajor = ${ major } ` )
20
- . replace ( this . MINOR_REGEX . exec ( contents ) [ 0 ] , `versionMinor = ${ minor } ` )
21
- . replace ( this . PATCH_REGEX . exec ( contents ) [ 0 ] , `versionPatch = ${ patch } ` ) ;
19
+ . replace ( this . MAJOR_REGEX , `versionMajor = ${ major } ` )
20
+ . replace ( this . MINOR_REGEX , `versionMinor = ${ minor } ` )
21
+ . replace ( this . PATCH_REGEX , `versionPatch = ${ patch } ` ) ;
22
+ }
23
+ }
24
+
25
+ const moduleVersionUpdater = {
26
+ GO_MOD_REGEX : / s t r e a m - c h a t - g o \/ v ( \d + ) / g,
27
+
28
+ readVersion : function ( contents ) {
29
+ return this . GO_MOD_REGEX . exec ( contents ) [ 1 ] ;
30
+ } ,
31
+
32
+ writeVersion : function ( contents , version ) {
33
+ const major = version . split ( '.' ) [ 0 ] ;
34
+
35
+ return contents . replace ( this . GO_MOD_REGEX , `stream-chat-go/v${ major } ` ) ;
22
36
}
23
37
}
24
38
25
39
module . exports = {
26
- bumpFiles : [ { filename : './version.go' , updater : versionFileUpdater } ] ,
40
+ bumpFiles : [
41
+ { filename : './version.go' , updater : versionFileUpdater } ,
42
+ { filename : './go.mod' , updater : moduleVersionUpdater } ,
43
+ { filename : './README.md' , updater : moduleVersionUpdater } ,
44
+ ] ,
27
45
}
0 commit comments