]> source.dussan.org Git - jquery.git/commitdiff
build: update release script to use nodejs archiver.
authorChris Talkington <chris@talkingtontech.com>
Sun, 12 May 2013 21:21:31 +0000 (16:21 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Fri, 17 May 2013 01:59:34 +0000 (21:59 -0400)
(cherry picked from commit eaee6eae0fee57337fabe41eb4558cf1acdf765b)

Conflicts:
AUTHORS.txt

AUTHORS.txt
build/release.js
package.json

index 5cfbb1465df39351c402043accb79d6440c691c3..bd69f5f35bfd7a23f606fbfd9bd355381a706778 100644 (file)
@@ -163,7 +163,7 @@ Adam Coulombe <me@adam.co>
 Andrew Plummer <plummer.andrew@gmail.com>
 Dmitry Gusev <dmitry.gusev@gmail.com>
 Michał Gołębiowski <m.goleb@gmail.com>
-Brandon Johnson <bjohn465+github@gmail.com>
 Jason Bedard <jason+jquery@jbedard.ca>
 Kyle Robinson Young <kyle@dontkry.com>
 Renato Oliveira dos Santos <ros3@cin.ufpe.br>
+Chris Talkington <chris@talkingtontech.com>
\ No newline at end of file
index bd9786eb4f30338b022be7ed06a879b4953d0ce8..57661d3ecec30db6e9568ec752ad005364cac8c7 100644 (file)
@@ -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 );
 }
 
index 20ef666d8daaf0ab61968b35e517c86038ad75a1..12f58e34c8ade346435ec049049b25e1f909ad74 100644 (file)
@@ -31,7 +31,8 @@
                "grunt-contrib-uglify": "0.2.0",
                "grunt": "0.4.1",
                "gzip-js": "0.3.1",
-               "testswarm": "0.2.2"
+               "testswarm": "0.2.2",
+               "archiver": "~0.4.2"
        },
        "keywords": []
 }