From c521fa9bfab9fd3fbd5d56e2a3ac2c961bea2f4d Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Wed, 23 Jun 2021 13:11:29 +0100 Subject: [PATCH] Fix release process The documented release process is to do npm run recompile, merge the resulting branch to develop, and then do npm run relase, which does not do another build. This process should probably be changed, but for the moment ensure that npm run recompile (as well as npm run package:beta) runs buildTasks.checkinBuilt after each .build to preserve the old procedure. --- scripts/gulpfiles/git_tasks.js | 2 ++ scripts/gulpfiles/package_tasks.js | 10 +++++++++- scripts/gulpfiles/release_tasks.js | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/gulpfiles/git_tasks.js b/scripts/gulpfiles/git_tasks.js index f08ab9e00..bfc28df4c 100644 --- a/scripts/gulpfiles/git_tasks.js +++ b/scripts/gulpfiles/git_tasks.js @@ -103,7 +103,9 @@ const updateGithubPages = gulp.series( execSync('git reset --hard upstream/develop', { stdio: 'inherit' }); done(); }, + buildTasks.cleanBuildDir, buildTasks.build, + buildTasks.checkinBuilt, function(done) { execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); execSync('git push ' + upstream_url + ' gh-pages --force', { stdio: 'inherit' }); diff --git a/scripts/gulpfiles/package_tasks.js b/scripts/gulpfiles/package_tasks.js index de4c5dad0..6fef12152 100644 --- a/scripts/gulpfiles/package_tasks.js +++ b/scripts/gulpfiles/package_tasks.js @@ -17,12 +17,20 @@ gulp.umd = require('gulp-umd'); var path = require('path'); var fs = require('fs'); +var rimraf = require('rimraf'); var {getPackageJson} = require('./helper_tasks'); -var {BUILD_DIR, RELEASE_DIR} = require('./config'); +var {RELEASE_DIR} = require('./config'); // Path to template files for gulp-umd. const TEMPLATE_DIR = 'scripts/package/templates'; +// Path from which to pull files to package. +// +// TODO(cpcallen): Use BUILD_DIR from config.js once release_tasks are +// updated to do build-package-release all in one go, instead of doing +// build-checkin and then package-release as separate steps. +var BUILD_DIR = '.'; + /** * A helper method for wrapping a file into a Universal Module Definition. * @param {string} namespace The export namespace. diff --git a/scripts/gulpfiles/release_tasks.js b/scripts/gulpfiles/release_tasks.js index e98639b48..b0faa759f 100644 --- a/scripts/gulpfiles/release_tasks.js +++ b/scripts/gulpfiles/release_tasks.js @@ -160,7 +160,9 @@ const publish = gulp.series( // Publish a beta version of Blockly. const publishBeta = gulp.series( updateBetaVersion, + buildTasks.cleanBuildDir, buildTasks.build, + buildTasks.checkinBuilt, packageTasks.package, checkBranch, checkReleaseDir, @@ -172,7 +174,9 @@ const recompile = gulp.series( gitTasks.syncDevelop(), gitTasks.createRebuildBranch, updateVersionPrompt, + buildTasks.cleanBuildDir, buildTasks.build, + buildTasks.checkinBuilt, typings.typings, gitTasks.pushRebuildBranch );