From ff87c135eedbf7576d5d78dcef214faca8590f46 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 18 Oct 2019 10:56:47 -0700 Subject: [PATCH 1/4] 3.20191018.0-develop --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e149f20aa..2bdeb72e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "2.20190722.0-develop", + "version": "3.20191018.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 41f86d187..7e25ac26a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20191014.0-develop", + "version": "3.20191018.0-develop", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 3946b56a261278001a7efeb237eb0a8907c86118 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 18 Oct 2019 14:23:17 -0700 Subject: [PATCH 2/4] Add script to bump minor version number Creates a new branch, bumps, builds, tags, and pushes the new branch and new tag. --- gulpfile.js | 39 +++++++++++++++++++++++++++++++++++++-- package.json | 4 ++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d879fdb84..f31e784f9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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(); @@ -809,6 +810,15 @@ function getRCBranchName() { return 'rc_' + yyyy + '_' + mm; }; +// Helper function: get a minor version number for the day. Format: yyyymmdd. +function getNewMinorVersionNumber() { + var date = new Date(); + var mm = date.getMonth() + 1; // Month, 0-11 + var dd = date.getDate(); // Day of the month, 1-31 + var yyyy = date.getFullYear(); + return yyyy + '' + mm + '' + dd; +}; + // Recompile and push to origin. gulp.task('recompile', gulp.series([ 'git-sync-develop', @@ -838,9 +848,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(); + } + ]) +); diff --git a/package.json b/package.json index 7e25ac26a..e7b9d8b9a 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,10 @@ "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", + "version": "gulp build && git add -A", + "preversion": "gulp preversion", + "postversion": "gulp postversion", "lint": "eslint .", "package": "gulp package", "prepare": "npm run package", From e716283191148f5978174e7a17573ff25f34b3a5 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 18 Oct 2019 10:56:47 -0700 Subject: [PATCH 3/4] Revert "3.20191018.0-develop" This reverts commit ff87c135eedbf7576d5d78dcef214faca8590f46. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2bdeb72e1..e149f20aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20191018.0-develop", + "version": "2.20190722.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e7b9d8b9a..02fbdbb10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockly", - "version": "3.20191018.0-develop", + "version": "3.20191014.0-develop", "description": "Blockly is a library for building visual programming editors.", "keywords": [ "blockly" From 1e2eb6bd602c45831a589cb3e996745a29671a47 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 21 Oct 2019 10:46:34 -0700 Subject: [PATCH 4/4] Review cleanup --- gulpfile.js | 9 --------- package.json | 10 +++++----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index f31e784f9..ce232b7c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -810,15 +810,6 @@ function getRCBranchName() { return 'rc_' + yyyy + '_' + mm; }; -// Helper function: get a minor version number for the day. Format: yyyymmdd. -function getNewMinorVersionNumber() { - var date = new Date(); - var mm = date.getMonth() + 1; // Month, 0-11 - var dd = date.getDate(); // Day of the month, 1-31 - var yyyy = date.getFullYear(); - return yyyy + '' + mm + '' + dd; -}; - // Recompile and push to origin. gulp.task('recompile', gulp.series([ 'git-sync-develop', diff --git a/package.json b/package.json index 02fbdbb10..612470f57 100644 --- a/package.json +++ b/package.json @@ -20,19 +20,19 @@ "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", - "version": "gulp build && git add -A", - "preversion": "gulp preversion", - "postversion": "gulp postversion", "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",