Files
blockly/gulpfile.js
alschmiedt 40d39fd0c5 Update gh pages task (#3762)
* Add task for updating github pages from develop
2020-03-23 16:49:03 -07:00

64 lines
1.9 KiB
JavaScript

/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Gulp script to build Blockly for Node & NPM.
* Run this script by calling "npm install" in this directory.
*/
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');
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,
buildCore: buildTasks.core,
buildBlocks: buildTasks.blocks,
buildLangfiles: buildTasks.langfiles,
buildUncompressed: buildTasks.uncompressed,
buildCompressed: buildTasks.compressed,
buildGenerators: buildTasks.generators,
preversion: preversion,
postversion: postversion,
gitSyncDevelop: gitTasks.syncDevelop,
gitSyncMaster: gitTasks.syncMaster,
gitCreateRC: gitTasks.createRC,
gitRecompile: gitTasks.recompile,
gitUpdateGithubPages: gitTasks.updateGithubPages,
typings: typings.typings,
package: packageTasks.package,
checkLicenses: licenseTasks.checkLicenses
};