Skip to content

Commit 911d2f6

Browse files
publish script elaboration
1 parent 38419fb commit 911d2f6

File tree

16 files changed

+54
-24
lines changed

16 files changed

+54
-24
lines changed

packages/bigquery/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@google-cloud/bigquery",
3-
"version": "0.1.0",
3+
"version": "0.30.0",
44
"author": "Google Inc.",
55
"description": "Google BigQuery Client Library for Node.js",
66
"contributors": [
@@ -68,7 +68,7 @@
6868
"proxyquire": "^1.7.10"
6969
},
7070
"scripts": {
71-
"publish": "node ../../scripts/publish.js",
71+
"publish": "node ../../scripts/publish.js bigquery",
7272
"test": "mocha test/*.js",
7373
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7474
},

packages/bigtable/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"sinon": "^1.17.4"
7575
},
7676
"scripts": {
77-
"publish": "node ../../scripts/publish.js",
77+
"publish": "node ../../scripts/publish.js bigtable",
7878
"test": "mocha test/*.js",
7979
"system-test": "mocha system-test/*.js --no-timeouts --bail"
8080
},

packages/common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"sinon": "^1.17.4"
6767
},
6868
"scripts": {
69-
"publish": "node ../../scripts/publish.js",
69+
"publish": "node ../../scripts/publish.js common",
7070
"test": "mocha test/*.js"
7171
},
7272
"license": "Apache-2.0",

packages/compute/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"proxyquire": "^1.7.10"
6868
},
6969
"scripts": {
70-
"publish": "node ../../scripts/publish.js",
70+
"publish": "node ../../scripts/publish.js compute",
7171
"test": "mocha test/*.js",
7272
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7373
},

packages/datastore/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"through2": "^2.0.0"
7171
},
7272
"scripts": {
73-
"publish": "node ../../scripts/publish.js",
73+
"publish": "node ../../scripts/publish.js datastore",
7474
"test": "mocha test/*.js",
7575
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7676
},

packages/dns/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"tmp": "0.0.27"
6767
},
6868
"scripts": {
69-
"publish": "../../scripts/publish",
69+
"publish": "../../scripts/publish dns",
7070
"test": "mocha test/*.js",
7171
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7272
},

packages/google-cloud/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"proxyquire": "^1.7.10"
113113
},
114114
"scripts": {
115-
"publish": "node ../../scripts/publish.js",
115+
"publish": "node ../../scripts/publish.js google-cloud",
116116
"test": "mocha test/*.js",
117117
"system-test": "mocha system-test/*.js --no-timeouts --bail"
118118
},

packages/language/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"proxyquire": "^1.7.10"
6767
},
6868
"scripts": {
69-
"publish": "../../scripts/publish.sh",
69+
"publish": "../../scripts/publish.sh language",
7070
"test": "mocha test/*.js",
7171
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7272
},

packages/logging/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"proxyquire": "^1.7.10"
7070
},
7171
"scripts": {
72-
"publish": "node ../../scripts/publish.js",
72+
"publish": "node ../../scripts/publish.js logging",
7373
"test": "mocha test/*.js",
7474
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7575
},

packages/prediction/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"proxyquire": "^1.7.10"
7070
},
7171
"scripts": {
72-
"publish": "node ../../scripts/publish.js",
72+
"publish": "node ../../scripts/publish.js prediction",
7373
"test": "mocha test/*.js",
7474
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7575
},

packages/pubsub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"proxyquire": "^1.7.10"
6565
},
6666
"scripts": {
67-
"publish": "node ../../scripts/publish.js",
67+
"publish": "node ../../scripts/publish.js pubsub",
6868
"test": "mocha test/*.js",
6969
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7070
},

packages/resource/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"proxyquire": "^1.7.10"
6262
},
6363
"scripts": {
64-
"publish": "node ../../scripts/publish.js",
64+
"publish": "node ../../scripts/publish.js resource",
6565
"test": "mocha test/*.js",
6666
"system-test": "mocha system-test/*.js --no-timeouts --bail"
6767
},

packages/storage/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"tmp": "0.0.27"
7979
},
8080
"scripts": {
81-
"publish": "node ../../scripts/publish.js",
81+
"publish": "node ../../scripts/publish.js storage",
8282
"test": "mocha test/*.js",
8383
"system-test": "mocha system-test/*.js --no-timeouts --bail"
8484
},

packages/translate/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"proxyquire": "^1.7.10"
6262
},
6363
"scripts": {
64-
"publish": "node ../../scripts/publish.js",
64+
"publish": "node ../../scripts/publish.js translate",
6565
"test": "mocha test/*.js",
6666
"system-test": "mocha system-test/*.js --no-timeouts --bail"
6767
},

packages/vision/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"tmp": "0.0.27"
7272
},
7373
"scripts": {
74-
"publish": "node ../../scripts/publish.js",
74+
"publish": "node ../../scripts/publish.js vision",
7575
"test": "mocha test/*.js",
7676
"system-test": "mocha system-test/*.js --no-timeouts --bail"
7777
},

scripts/publish.js

+38-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,44 @@ cp(path.join(__dirname, '../AUTHORS'), cwd);
2828
cp(path.join(__dirname, '../CONTRIBUTORS'), cwd);
2929
cp(path.join(__dirname, '../COPYING'), cwd);
3030

31-
// Publish the module
32-
exec('echo "npm publish ."', {
31+
var args = process.argv.splice(1);
32+
var moduleName = args[1];
33+
var newVersion = args[2];
34+
var tagName = [moduleName, newVersion].join('-');
35+
36+
if (moduleName === 'google-cloud') {
37+
tagName = newVersion;
38+
}
39+
40+
// Create a git tag
41+
exec('git tag -a ' + tagName + ' -m "' + moduleName + ' release for ' + newVersion + '"', {
42+
cwd: cwd
43+
});
44+
45+
// Increment the version
46+
exec('npm --no-git-tag-version version ' + newVersion, {
3347
cwd: cwd
3448
});
3549

36-
// Remove the duplicated files
37-
rm([
38-
path.join(cwd, 'AUTHORS'),
39-
path.join(cwd, 'CONTRIBUTORS'),
40-
path.join(cwd, 'COPYING')
41-
]);
50+
console.log('Publishing package in 10 seconds. Exit process to abort');
51+
52+
setTimeout(function() {
53+
console.log('Publishing now');
54+
55+
// Publish the module
56+
exec('npm publish', {
57+
cwd: cwd
58+
});
59+
60+
exec('echo "Now push to master: git push origin master --follow-tags"', {
61+
cwd: cwd
62+
});
63+
64+
// Remove the duplicated files
65+
rm([
66+
path.join(cwd, 'AUTHORS'),
67+
path.join(cwd, 'CONTRIBUTORS'),
68+
path.join(cwd, 'COPYING')
69+
]);
70+
}, 10000);
71+

0 commit comments

Comments
 (0)