Skip to content

Commit

Permalink
Require commit of release candidate. (tensorflow#3781)
Browse files Browse the repository at this point in the history
  • Loading branch information
lina128 authored Aug 12, 2020
1 parent c1f8897 commit 95dbfa2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/release-tfjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ async function main() {
newVersion = minorUpdateVersion;
}

// Get release candidate commit.
const commit = await question('Commit of release candidate: ');
if (commit === '') {
console.log(chalk.red('Commit cannot be empty.'));
process.exit(1);
}

// Create a release branch in remote.
$(`git clone ${urlBase}tensorflow/tfjs ${dir} --depth=1`);
$(`git clone ${urlBase}tensorflow/tfjs ${dir}`);
shell.cd(dir);
const releaseBranch = `tfjs_${newVersion}`;
console.log(chalk.magenta.bold(
`~~~ Creating new release branch ${releaseBranch} ~~~`));
$(`git checkout -b ${releaseBranch}`);
$(`git checkout -b ${releaseBranch} ${commit}`);
$(`git push origin ${releaseBranch}`);

// Update version.
Expand Down Expand Up @@ -94,8 +101,7 @@ async function main() {

shell.cd('..');

// Make version for all packages other than tfjs-node-gpu. Consider
// remove make version.
// Make version for all packages other than tfjs-node-gpu.
if (packageName !== 'tfjs-node-gpu') {
$(`./scripts/make-version.js ${packageName}`);
}
Expand Down

0 comments on commit 95dbfa2

Please sign in to comment.