Update build scripts (#3923)

* Update build scripts
This commit is contained in:
alschmiedt
2020-05-28 17:10:52 -07:00
committed by GitHub
parent acfc335870
commit 8ec3a49487
3 changed files with 12 additions and 36 deletions

View File

@@ -10,9 +10,6 @@
*/
var gulp = require('gulp');
var execSync = require('child_process').execSync;
var packageJson = require('./package.json');
var typings = require('./scripts/gulpfiles/typings');
var buildTasks = require('./scripts/gulpfiles/build_tasks');
@@ -20,27 +17,6 @@ var packageTasks = require('./scripts/gulpfiles/package_tasks');
var gitTasks = require('./scripts/gulpfiles/git_tasks');
var licenseTasks = require('./scripts/gulpfiles/license_tasks');
// See https://docs.npmjs.com/cli/version.
const preversion = gulp.series(
gitTasks.syncMaster,
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
function postversion(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();
};
module.exports = {
default: buildTasks.build,
build: buildTasks.build,
@@ -50,8 +26,6 @@ module.exports = {
buildUncompressed: buildTasks.uncompressed,
buildCompressed: buildTasks.compressed,
buildGenerators: buildTasks.generators,
preversion: preversion,
postversion: postversion,
gitSyncDevelop: gitTasks.syncDevelop,
gitSyncMaster: gitTasks.syncMaster,
gitCreateRC: gitTasks.createRC,

View File

@@ -1,6 +1,6 @@
{
"name": "blockly",
"version": "3.20200402.0-develop",
"version": "3.20200402.0",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
@@ -26,14 +26,12 @@
"build:generators": "gulp buildGenerators",
"build:langfiles": "gulp buildLangfiles",
"build:uncompressed": "gulp buildUncompressed",
"bump": "npm version 3.$(date +'%Y%m%d').0",
"bump": "npm --no-git-tag-version version 3.$(date +'%Y%m%d').0",
"license": "gulp checkLicenses",
"lint": "eslint .",
"package": "gulp package",
"postversion": "gulp postversion",
"prepare": "npm run package",
"preversion": "gulp preversion",
"prerelease": "gulp gitRecompile",
"recompile": "gulp gitRecompile",
"release": "gulp gitCreateRC",
"test": "concurrently 'npm run test:prepare' 'sleep 5 && npm run test:run'",
"test:prepare": "npm run test:setupselenium && npm run test:startselenium",
@@ -41,8 +39,7 @@
"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",
"updateGithubPages": "gulp gitUpdateGithubPages",
"version": "gulp build && git add -A"
"updateGithubPages": "gulp gitUpdateGithubPages"
},
"main": "./index.js",
"umd": "./blockly.min.js",

View File

@@ -10,6 +10,7 @@
var gulp = require('gulp');
var execSync = require('child_process').execSync;
var exec = require('child_process').exec;
var typings = require('./typings');
var buildTasks = require('./build_tasks');
@@ -56,7 +57,7 @@ function getRCBranchName() {
return 'rc_' + yyyy + '_' + mm;
};
// If branch does not exist then create the branch.
// If branch does not exist then create the branch.
// If branch exists switch to branch.
function checkoutBranch(branchName) {
execSync('git checkout ' + branchName + ' || git checkout -b ' + branchName,
@@ -65,13 +66,17 @@ function checkoutBranch(branchName) {
// Recompile and push to origin.
const recompile = gulp.series(
syncDevelop,
syncDevelop(),
function(done) {
var branchName = getRebuildBranchName();
console.log('make-rebuild-branch: creating branch ' + branchName);
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });
done();
},
function(done) {
exec('npm run bump');
done();
},
buildTasks.build,
typings.typings,
function(done) {
@@ -88,7 +93,7 @@ const recompile = gulp.series(
// Create and push an RC branch.
// Note that this pushes to google/blockly.
const createRC = gulp.series(
syncDevelop,
syncDevelop(),
function(done) {
var branchName = getRCBranchName();
execSync('git checkout -b ' + branchName, { stdio: 'inherit' });