Skip to content

Commit

Permalink
publish script elaboration
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Aug 10, 2016
1 parent 38419fb commit 911d2f6
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 24 deletions.
4 changes: 2 additions & 2 deletions packages/bigquery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google-cloud/bigquery",
"version": "0.1.0",
"version": "0.30.0",
"author": "Google Inc.",
"description": "Google BigQuery Client Library for Node.js",
"contributors": [
Expand Down Expand Up @@ -68,7 +68,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js bigquery",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bigtable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"sinon": "^1.17.4"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js bigtable",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"sinon": "^1.17.4"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js common",
"test": "mocha test/*.js"
},
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/compute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js compute",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/datastore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"through2": "^2.0.0"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js datastore",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/dns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"tmp": "0.0.27"
},
"scripts": {
"publish": "../../scripts/publish",
"publish": "../../scripts/publish dns",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js google-cloud",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "../../scripts/publish.sh",
"publish": "../../scripts/publish.sh language",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js logging",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/prediction/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js prediction",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js pubsub",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/resource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js resource",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"tmp": "0.0.27"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js storage",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/translate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"proxyquire": "^1.7.10"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js translate",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"tmp": "0.0.27"
},
"scripts": {
"publish": "node ../../scripts/publish.js",
"publish": "node ../../scripts/publish.js vision",
"test": "mocha test/*.js",
"system-test": "mocha system-test/*.js --no-timeouts --bail"
},
Expand Down
46 changes: 38 additions & 8 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,44 @@ cp(path.join(__dirname, '../AUTHORS'), cwd);
cp(path.join(__dirname, '../CONTRIBUTORS'), cwd);
cp(path.join(__dirname, '../COPYING'), cwd);

// Publish the module
exec('echo "npm publish ."', {
var args = process.argv.splice(1);
var moduleName = args[1];
var newVersion = args[2];
var tagName = [moduleName, newVersion].join('-');

if (moduleName === 'google-cloud') {
tagName = newVersion;
}

// Create a git tag
exec('git tag -a ' + tagName + ' -m "' + moduleName + ' release for ' + newVersion + '"', {
cwd: cwd
});

// Increment the version
exec('npm --no-git-tag-version version ' + newVersion, {
cwd: cwd
});

// Remove the duplicated files
rm([
path.join(cwd, 'AUTHORS'),
path.join(cwd, 'CONTRIBUTORS'),
path.join(cwd, 'COPYING')
]);
console.log('Publishing package in 10 seconds. Exit process to abort');

setTimeout(function() {
console.log('Publishing now');

// Publish the module
exec('npm publish', {
cwd: cwd
});

exec('echo "Now push to master: git push origin master --follow-tags"', {
cwd: cwd
});

// Remove the duplicated files
rm([
path.join(cwd, 'AUTHORS'),
path.join(cwd, 'CONTRIBUTORS'),
path.join(cwd, 'COPYING')
]);
}, 10000);

0 comments on commit 911d2f6

Please sign in to comment.