Merge pull request #3289 from rachel-fenichel/release_tasks_3

Release task to bump minor version
This commit is contained in:
Rachel Fenichel
2019-10-21 10:52:55 -07:00
committed by GitHub
2 changed files with 34 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ var closureCompiler = require('google-closure-compiler').gulp();
var packageJson = require('./package.json');
var argv = require('yargs').argv;
const upstream_url = "https://github.com/google/blockly.git";
////////////////////////////////////////////////////////////
// Build //
@@ -779,7 +780,7 @@ function syncBranch(branchName) {
return function(done) {
execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' });
execSync('git checkout ' + branchName, { stdio: 'inherit' });
execSync('git pull https://github.com/google/blockly.git ' + branchName,
execSync('git pull ' + upstream_url + ' ' + branchName,
{ stdio: 'inherit' });
execSync('git push origin ' + branchName, { stdio: 'inherit' });
done();
@@ -838,9 +839,34 @@ gulp.task('git-create-rc', gulp.series([
function(done) {
var branchName = getRCBranchName();
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
execSync('git push https://github.com/google/blockly.git ' + branchName,
execSync('git push ' + upstream_url + ' ' + branchName,
{ stdio: 'inherit' });
done();
},
])
);
// See https://docs.npmjs.com/cli/version.
gulp.task('preversion', gulp.series([
'git-sync-master',
function(done) {
// Create a branch named bump_version for the bump and rebuild.
execSync('git checkout -b bump_version', { stdio: 'inherit' });
done();
},
])
);
// See https://docs.npmjs.com/cli/version
gulp.task('postversion', gulp.series([
function(done) {
// Push both the branch and tag to google/blockly.
execSync('git push ' + upstream_url + ' bump_version',
{ stdio: 'inherit' });
var tagName = 'v' + packageJson.version;
execSync('git push ' + upstream_url + ' ' + tagName,
{ stdio: 'inherit' });
done();
}
])
);

View File

@@ -19,16 +19,20 @@
"scripts": {
"build": "gulp build",
"build:debug": "gulp build-core --verbose > build-debug.log 2>&1 && tail -3 -r build-debug.log",
"bump": "npm version 3.$(date +'%Y%m%d').0",
"lint": "eslint .",
"package": "gulp package",
"postversion": "gulp postversion",
"prepare": "npm run package",
"preversion": "gulp preversion",
"release": "gulp release",
"test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'",
"test:run": "tests/run_all_tests.sh",
"test:prepare": "npm run test:setupselenium && npm run test:startselenium",
"test:run": "tests/run_all_tests.sh",
"test:setupselenium": "selenium-standalone install --config=./tests/scripts/selenium-config.js",
"test:startselenium": "selenium-standalone start --config=./tests/scripts/selenium-config.js",
"typings": "gulp typings"
"typings": "gulp typings",
"version": "gulp build && git add -A"
},
"main": "./index.js",
"umd": "./blockly.min.js",