@@ -6,10 +6,10 @@ const version = require('./version');
66const ux = require ( './ux' ) ;
77
88module . exports = async function publish (
9- releaseVersion , { downloadCenter, github }
9+ releaseVersion , { downloadCenter, github, changelog }
1010) {
1111 await uploadConfigIfNewer ( releaseVersion , { downloadCenter } ) ;
12- await waitGithubRelease ( releaseVersion , { github } ) ;
12+ await waitGithubRelease ( releaseVersion , { github, changelog } ) ;
1313
1414 cli . info (
1515 '\n' ,
@@ -40,19 +40,30 @@ async function uploadConfigIfNewer(
4040 cli . action . stop ( ) ;
4141}
4242
43- async function waitGithubRelease ( releaseVersion , { github } ) {
43+ async function waitGithubRelease ( releaseVersion , { github, changelog } ) {
44+ cli . info ( '\n' + ux . separator ( `👇 CHANGELOG FOR ${ releaseVersion } ` ) ) ;
45+ await changelog . render ( releaseVersion ) ;
46+ cli . info ( '\n' + ux . separator ( '👆 CHANGELOG' ) , '\n' ) ;
47+
4448 cli . info (
4549 '\n' ,
4650 ux . manualAction (
4751 'Make sure the release is published on Github: ' ,
4852 ux . link ( 'https://github.com/mongodb-js/compass/releases' ) , '\n\n' ,
49- 'You can run ' , ux . command ( 'npm run release changelog' ) , ' to get the release notes .', '\n\n' ,
53+ 'Copy the changelog from above and put it into the description of the release.' , '\n\n' ,
5054 chalk . bold ( 'NOTE:' ) , ' if a release is not published on Github the Compass auto-update will not pick that up.' ,
5155 ) ,
5256 '\n'
5357 ) ;
5458
55- cli . action . start ( `Waiting for Github release ${ chalk . bold ( releaseVersion ) } to be published.` ) ;
56- await github . waitForReleasePublished ( releaseVersion ) ;
59+ cli . info ( 'Press enter when you have published the Github release...' ) ;
60+ ux . waitForEnter ( ) ;
61+
62+ cli . action . start ( `Checking if Github release ${ chalk . bold ( releaseVersion ) } really is published.` ) ;
63+ const alreadyPublished = await github . isReleasePublished ( releaseVersion ) ;
64+ if ( ! alreadyPublished ) {
65+ cli . error ( 'Release is not published yet - did you really publish?' ) ;
66+ cli . info ( 'Please publish the release on Github and run publish again to verify it worked.' ) ;
67+ }
5768 cli . action . stop ( ) ;
5869}
0 commit comments