Skip to content

Commit a31f28b

Browse files
committed
Update release script and notes builder.
1 parent 0ca936d commit a31f28b

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

build/release-notes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ var fs = require("fs"),
99
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
1010

1111
var opts = {
12-
version: "1.8",
13-
short_version: "1.8",
14-
final_version: "1.8",
12+
version: "1.81",
13+
short_version: "1.8.1",
14+
final_version: "1.8.1",
1515
categories: []
1616
};
1717

build/release.js

+17-27
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var releaseVersion,
2424
branch = "master",
2525

2626
// Windows needs the .cmd version but will find the non-.cmd
27-
// On Windows, run from the Windows prompt, not a Cygwin shell
27+
// On Windows, ensure the HOME environment variable is set
2828
gruntCmd = process.platform === "win32" ? "grunt.cmd" : "grunt",
2929

3030
devFile = "dist/jquery.js",
@@ -61,9 +61,6 @@ function initialize( next ) {
6161
patch = version[3],
6262
xbeta = version[4];
6363

64-
if ( debug ) {
65-
console.warn("=== DEBUG MODE ===" );
66-
}
6764

6865
releaseVersion = process.argv[2];
6966
isBeta = !!xbeta;
@@ -72,23 +69,25 @@ function initialize( next ) {
7269
die( "Usage: " + process.argv[1] + " releaseVersion" );
7370
}
7471
if ( xbeta === "pre" ) {
75-
die( "Cannot release a 'pre' version" );
72+
die( "Cannot release a 'pre' version!" );
7673
}
7774
if ( !(fs.existsSync || path.existsSync)( "package.json" ) ) {
7875
die( "No package.json in this directory" );
7976
}
80-
77+
if ( debug ) {
78+
console.warn("=== DEBUG MODE ===" );
79+
}
8180
pkg = JSON.parse( fs.readFileSync( "package.json" ) );
8281

8382
console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion );
8483
version = pkg.version.match( rversion );
85-
oldver = (+version[1]) * 10000 + (+version[2] * 100) + (+version[3])
86-
newver = (+major) * 10000 + (+minor * 100) + (+patch);
84+
oldver = ( +version[1] ) * 10000 + ( +version[2] * 100 ) + ( +version[3] )
85+
newver = ( +major ) * 10000 + ( +minor * 100 ) + ( +patch );
8786
if ( newver < oldver ) {
8887
die( "Next version is older than current version!" );
8988
}
9089

91-
nextVersion = major + "." + minor + "." + (isBeta? patch : +patch + 1) + "pre";
90+
nextVersion = major + "." + minor + "." + ( isBeta ? patch : +patch + 1 ) + "pre";
9291
next();
9392
}
9493
function checkGitStatus( next ) {
@@ -134,28 +133,18 @@ function uploadToCDN( next ) {
134133

135134
Object.keys( finalFiles ).forEach(function( name ) {
136135
cmds.push(function( x ){
137-
exec( "scp " + name + " " + scpURL, x );
136+
exec( "scp " + name + " " + scpURL, x, skipRemote );
138137
});
139138
cmds.push(function( x ){
140-
exec( "curl '" + cdnURL + name + "?reload'", x );
139+
exec( "curl '" + cdnURL + name + "?reload'", x, skipRemote );
141140
});
142141
});
143142
cmds.push( next );
144143

145-
if ( skipRemote ) {
146-
console.warn("Skipping remote file copies");
147-
next();
148-
} else {
149-
steps.apply( this, cmds );
150-
}
144+
steps.apply( this, cmds );
151145
}
152146
function pushToGithub( next ) {
153-
if ( skipRemote ) {
154-
console.warn("Skipping git push --tags");
155-
next();
156-
} else {
157-
exec("git push --tags "+ repoURL + " " + branch, next );
158-
}
147+
exec("git push --tags "+ repoURL + " " + branch, next, skipRemote );
159148
}
160149

161150
//==============================
@@ -181,11 +170,12 @@ function copy( oldFile, newFile ) {
181170
fs.writeFileSync( newFile, fs.readFileSync( oldFile, "utf8" ) );
182171
}
183172
}
184-
function exec( cmd, fn ) {
185-
console.log( cmd );
186-
if ( debug ) {
173+
function exec( cmd, fn, skip ) {
174+
if ( debug || skip ) {
175+
console.log( "# " + cmd );
187176
fn();
188177
} else {
178+
console.log( cmd );
189179
child.exec( cmd, { env: process.env }, function( err, stdout, stderr ) {
190180
if ( err ) {
191181
die( stderr || stdout || err );
@@ -195,7 +185,7 @@ function exec( cmd, fn ) {
195185
}
196186
}
197187
function die( msg ) {
198-
console.error( "Error: " + msg );
188+
console.error( "ERROR: " + msg );
199189
process.exit( 1 );
200190
}
201191
function exit() {

0 commit comments

Comments
 (0)