aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorChris Talkington <chris@talkingtontech.com>2013-05-12 16:21:31 -0500
committerDave Methvin <dave.methvin@gmail.com>2013-05-16 21:59:34 -0400
commit3a59f8ad6e2004e1a191173373accab03a1cc4b7 (patch)
tree91a907093ea259b78749a689e4192eeceee976ef /build
parentbefc11e3949559c518982528c9b0f9e45bfe6fa8 (diff)
downloadjquery-3a59f8ad6e2004e1a191173373accab03a1cc4b7.tar.gz
jquery-3a59f8ad6e2004e1a191173373accab03a1cc4b7.zip
build: update release script to use nodejs archiver.
(cherry picked from commit eaee6eae0fee57337fabe41eb4558cf1acdf765b) Conflicts: AUTHORS.txt
Diffstat (limited to 'build')
-rw-r--r--build/release.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/build/release.js b/build/release.js
index bd9786eb4..57661d3ec 100644
--- a/build/release.js
+++ b/build/release.js
@@ -9,7 +9,13 @@ var debug = false,
var fs = require("fs"),
child = require("child_process"),
- path = require("path");
+ path = require("path"),
+ zlib = require("zlib");
+
+var archiver = require("archiver");
+var gzipOptions = {
+ level: 9
+};
var releaseVersion,
nextVersion,
@@ -236,6 +242,19 @@ function makeArchive( cdn, files, fn ) {
console.log( "Creating production archive for " + cdn );
+ var gzipper = zlib.createGzip( gzipOptions );
+ var output = fs.createWriteStream( "dist/" + cdn + "-jquery-" + releaseVersion + ".tar.gz" );
+
+ var archive = archiver( "tar" );
+
+ archive.on( "error", function( err ) {
+ throw err;
+ });
+
+ output.on( "close", fn );
+
+ archive.pipe( gzipper ).pipe( output );
+
files = files.map(function( item ) {
return "dist/" + item.replace( /VER/g, releaseVersion );
});
@@ -244,7 +263,12 @@ function makeArchive( cdn, files, fn ) {
exec( "md5sum", files, function( err, stdout, stderr ) {
fs.writeFileSync( md5file, stdout );
files.push( md5file );
- exec( "tar", [ "-czvf", "dist/" + cdn + "-jquery-" + releaseVersion + ".tar.gz" ].concat( files ), fn, false );
+
+ files.forEach(function( file ) {
+ archive.append( fs.createReadStream( file ), { name: file } );
+ });
+
+ archive.finalize();
}, false );
}