Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions build/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ function tagReleaseVersion( next ) {
function updateVersions( next ) {
updateSourceVersion( releaseVersion );
updateReadmeVersion( releaseVersion );
updatePackageVersion( releaseVersion );
next();
updatePackageVersion( releaseVersion, undefined, next );
}

async function buildRelease( next ) {
Expand Down Expand Up @@ -211,9 +210,12 @@ async function publishToNPM( next ) {

function setNextVersion( next ) {
updateSourceVersion( nextVersion );
updatePackageVersion( nextVersion, "main" );
git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ],
next );
updatePackageVersion( nextVersion, "main", function() {
git(
[ "commit", "-a", "--no-verify",
"-m", "Updating the source version to " + nextVersion ],
next );
} );
}

function pushToRemote( next ) {
Expand Down Expand Up @@ -244,12 +246,22 @@ function steps() {
} )();
}

function updatePackageVersion( ver, blobVer ) {
function updatePackageVersion( ver, blobVer, next ) {
status( "Updating " + packageFile + " version to " + ver );
blobVer = blobVer || ver;
pkg.version = ver;
pkg.author.url = setBlobVersion( pkg.author.url, blobVer );
writeJsonSync( packageFile, pkg );
child.execFile( "npm", [
"version",
ver,
"--no-git-tag-version"
], function( error, stdout ) {
if ( error ) {
throw error;
}
console.log( stdout );
next();
} );
}

function updateSourceVersion( ver ) {
Expand Down
Loading