Add task to create a release candidate.

This commit is contained in:
Rachel Fenichel
2019-10-17 15:45:43 -07:00
parent 5c8a5e3007
commit 5507a1eb88

View File

@@ -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();
},
])
);