@@ -28,14 +28,44 @@ cp(path.join(__dirname, '../AUTHORS'), cwd);
28
28
cp ( path . join ( __dirname , '../CONTRIBUTORS' ) , cwd ) ;
29
29
cp ( path . join ( __dirname , '../COPYING' ) , cwd ) ;
30
30
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 , {
33
47
cwd : cwd
34
48
} ) ;
35
49
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