@@ -27,7 +27,7 @@ import * as argparse from 'argparse';
27
27
import chalk from 'chalk' ;
28
28
import * as fs from 'fs' ;
29
29
import * as shell from 'shelljs' ;
30
- import { TMP_DIR , $ , question , makeReleaseDir , createPR , TFJS_RELEASE_UNIT , updateTFJSDependencyVersions , ALPHA_RELEASE_UNIT , getMinorUpdateVersion , getPatchUpdateVersion } from './release-util' ;
30
+ import { TMP_DIR , $ , question , makeReleaseDir , createPR , TFJS_RELEASE_UNIT , updateTFJSDependencyVersions , ALPHA_RELEASE_UNIT , getMinorUpdateVersion , getPatchUpdateVersion , E2E_PHASE } from './release-util' ;
31
31
32
32
const parser = new argparse . ArgumentParser ( ) ;
33
33
@@ -36,6 +36,11 @@ parser.addArgument('--git-protocol', {
36
36
help : 'Use the git protocol rather than the http protocol when cloning repos.'
37
37
} ) ;
38
38
39
+ parser . addArgument ( '--local' , {
40
+ action : 'storeTrue' ,
41
+ help : 'Only create the release branch locally. Do not push or create a PR.' ,
42
+ } ) ;
43
+
39
44
async function main ( ) {
40
45
const args = parser . parseArgs ( ) ;
41
46
const urlBase = args . git_protocol ?
'[email protected] :' :
'https://github.com/' ;
@@ -86,10 +91,14 @@ async function main() {
86
91
console . log ( chalk . magenta . bold (
87
92
`~~~ Creating new release branch ${ releaseBranch } ~~~` ) ) ;
88
93
$ ( `git checkout -b ${ releaseBranch } ${ commit } ` ) ;
89
- $ ( `git push origin ${ releaseBranch } ` ) ;
94
+ if ( ! args . local ) {
95
+ $ ( `git push origin ${ releaseBranch } ` ) ;
96
+ }
90
97
91
98
// Update versions in package.json files.
92
- const phases = [ ...TFJS_RELEASE_UNIT . phases , ...ALPHA_RELEASE_UNIT . phases ] ;
99
+ const phases = [
100
+ ...TFJS_RELEASE_UNIT . phases , ...ALPHA_RELEASE_UNIT . phases , E2E_PHASE
101
+ ] ;
93
102
for ( const phase of phases ) {
94
103
for ( const packageName of phase . packages ) {
95
104
shell . cd ( packageName ) ;
@@ -109,8 +118,8 @@ async function main() {
109
118
110
119
shell . cd ( '..' ) ;
111
120
112
- // Make version for all packages other than tfjs-node-gpu.
113
- if ( packageName !== 'tfjs-node-gpu' ) {
121
+ // Make version for all packages other than tfjs-node-gpu and e2e .
122
+ if ( packageName !== 'tfjs-node-gpu' && packageName !== 'e2e' ) {
114
123
$ ( `./scripts/make-version.js ${ packageName } ` ) ;
115
124
}
116
125
}
@@ -120,7 +129,9 @@ async function main() {
120
129
const devBranchName = `dev_${ releaseBranch } ` ;
121
130
122
131
const message = `Update monorepo to ${ newVersion } .` ;
123
- createPR ( devBranchName , releaseBranch , message ) ;
132
+ if ( ! args . local ) {
133
+ createPR ( devBranchName , releaseBranch , message ) ;
134
+ }
124
135
125
136
console . log (
126
137
'Done. FYI, this script does not publish to NPM. ' +
@@ -131,6 +142,9 @@ async function main() {
131
142
'Please remeber to update the website once you have released ' +
132
143
'a new package version.' ) ;
133
144
145
+ if ( args . local ) {
146
+ console . log ( `Local output located in ${ dir } ` )
147
+ }
134
148
process . exit ( 0 ) ;
135
149
}
136
150
0 commit comments