@@ -123,6 +123,12 @@ require('./internal/execute-tasks.js')({
123123 await Promise . all ( [
124124 fs . writeFile ( p ( 'package.json' ) , JSON . stringify ( rootPkg , null , 2 ) + '\n' , 'utf-8' ) ,
125125 updatePackage ( p ( 'package-lock.json' ) , 'package-lock.json' ) ,
126+ fs . readFile ( p ( 'cloudformation/template.yaml' ) , { encoding : 'utf-8' } )
127+ . then ( content => content . replace (
128+ / \/ v e r s i o n \/ { v\d + _ \d + _ \d + } : / g,
129+ `/version/{v${ newVersion . replace ( / \. / g, '_' ) } }:`
130+ ) )
131+ . then ( replaced => fs . writeFile ( p ( 'cloudformation/template.yaml' ) , replaced , { encoding : 'utf-8' } ) ) ,
126132 ...packageList
127133 . filter ( p => p . target !== '' )
128134 . map ( async ( { target, resolved } ) => Promise . all ( [
@@ -134,12 +140,21 @@ require('./internal/execute-tasks.js')({
134140 console . log ( green ( 'Committing updated packages' ) )
135141
136142 await exec ( 'git' , [
137- 'commit' , '--message' , `v${ newVersion } ` ,
138- 'lambdas/static-asset-uploader/build' ,
143+ 'add' ,
144+ p ( 'cloudformation/template.yaml' ) ,
145+ p ( 'lambdas/static-asset-uploader/build' ) ,
146+ ...(
147+ await Promise . all (
148+ packageList
149+ . map ( p => path . join ( p . target , 'node_modules' ) )
150+ . map ( f => fs . access ( f , fs . constants . R_OK ) . catch ( ( ) => null ) )
151+ )
152+ ) . filter ( f => f != null ) ,
139153 ...packageList . map ( p => path . join ( p . target , 'package.json' ) ) ,
140154 ...packageList . map ( p => path . join ( p . target , 'package-lock.json' ) )
141155 ] )
142156
157+ await exec ( 'git' , [ 'commit' , '--message' , `v${ newVersion } ` ] )
143158 await exec ( 'git' , [ 'tag' , `v${ newVersion } ` ] )
144159
145160 console . log ( green ( 'Release tag created: ' ) + blue ( `v${ newVersion } ` ) )
0 commit comments