File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,14 +330,33 @@ const runSemanticRelease = (isDryRun = false) => {
330330 childProcess . execSync ( `npx semantic-release ${ isDryRun ? '--dryRun' : '' } ` , {
331331 stdio : 'inherit' ,
332332 cwd : msDir ,
333- env : {
334- ...process . env ,
335- SEMANTIC_WORKING_DIR : msDir ,
336- SEMANTIC_ROOT_DIR : rootDir ,
337- } ,
333+ env : { ...process . env } ,
338334 } ) ;
339335
340- console . info ( chalk . green ( `Semantic release done: ${ msDir } ` ) ) ;
336+ let nextVersion = 'unknown' ;
337+
338+ try {
339+ const versionFile = findFile ( [ '.version' ] , `${ rootDir } /${ msDir } ` ) ;
340+
341+ if ( ! versionFile ) {
342+ throw new Error ( "Package file version doesn't exist." ) ;
343+ }
344+
345+ nextVersion = ( fs . readFileSync ( versionFile , { encoding : 'utf-8' } ) || '' ) . trim ( ) ;
346+
347+ if ( ! nextVersion ) {
348+ throw new Error ( 'Package version is empty.' ) ;
349+ }
350+
351+ childProcess . execSync ( `npx @lomray/microservices-cli patch-package-version --package-version ${ nextVersion } --dir ${ msDir } ` , {
352+ stdio : 'inherit' ,
353+ env : { ...process . env } ,
354+ } ) ;
355+ } catch ( e ) {
356+ console . info ( chalk . yellow ( `Failed get package version: ${ e . message } ` ) ) ;
357+ }
358+
359+ console . info ( chalk . green ( `Semantic release done: ${ msDir } . Version: ${ nextVersion } ` ) ) ;
341360 }
342361} ;
343362
You can’t perform that action at this time.
0 commit comments