From 5507a1eb8883718fb169d2600d36b71aeeb06bbb Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Thu, 17 Oct 2019 15:45:43 -0700 Subject: [PATCH 1/2] Add task to create a release candidate. --- gulpfile.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index b6bc06afc..288a487a4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -800,6 +800,18 @@ function getRebuildBranchName() { return 'rebuild_' + mm + '_' + dd + '_' + yyyy; }; +// Helper function: get a name for a rebuild branch. Format: rebuild_month_yyyy. +function getRCBranchName() { + var date = new Date(); + var monthNames = [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' + ]; + var month = monthNames[date.getMonth()]; + var yy = date.getFullYear().slice(-2); + return 'rc_' + month + '_' + yyyy; +}; + // Recompile and push to origin. gulp.task('recompile', gulp.series([ 'git-sync-develop', @@ -821,3 +833,17 @@ gulp.task('recompile', gulp.series([ } ]) ); + +// Create and push an RC branch. +// Note that this pushes to google/blockly. +gulp.task('git-create-rc', gulp.series([ + 'git-sync-develop', + function(done) { + var branchName = getRCBranchName(); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + execSync('git push https://github.com/google/blockly.git ' + branchName, + { stdio: 'inherit' }); + done(); + }, + ]) +); From 9fd4f8edffa58f447f28593eb0a282cb18a88b14 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 18 Oct 2019 10:23:55 -0700 Subject: [PATCH 2/2] Change branch name format --- gulpfile.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 288a487a4..649accc9e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -800,16 +800,12 @@ function getRebuildBranchName() { return 'rebuild_' + mm + '_' + dd + '_' + yyyy; }; -// Helper function: get a name for a rebuild branch. Format: rebuild_month_yyyy. +// Helper function: get a name for a rebuild branch. Format: rebuild_yyyy_mm. function getRCBranchName() { var date = new Date(); - var monthNames = [ - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' - ]; - var month = monthNames[date.getMonth()]; - var yy = date.getFullYear().slice(-2); - return 'rc_' + month + '_' + yyyy; + var mm = date.getMonth() + 1; // Month, 0-11 + var yyyy = date.getFullYear(); + return 'rc_' + yyyy + '_' + mm; }; // Recompile and push to origin.