Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions packages/blockly/gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,9 @@ import {
tsc,
} from './scripts/gulpfiles/build_tasks.mjs';
import {docs} from './scripts/gulpfiles/docs_tasks.mjs';
import {
createRC,
syncDevelop,
syncMaster,
updateGithubPages,
} from './scripts/gulpfiles/git_tasks.mjs';
import {createRC, updateGithubPages} from './scripts/gulpfiles/git_tasks.mjs';
import {cleanReleaseDir, pack} from './scripts/gulpfiles/package_tasks.mjs';
import {
publish,
publishBeta,
recompile,
} from './scripts/gulpfiles/release_tasks.mjs';
import {publish, publishBeta} from './scripts/gulpfiles/release_tasks.mjs';
import {
generators,
interactiveMocha,
Expand Down Expand Up @@ -89,12 +80,3 @@ export {
createRC as gitCreateRC,
docs,
}

// Legacy targets, to be deleted.
//
// prettier-ignore
export {
recompile,
syncDevelop as gitSyncDevelop,
syncMaster as gitSyncMaster,
}
34 changes: 13 additions & 21 deletions packages/blockly/scripts/gulpfiles/git_tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {execSync} from 'child_process';
import * as buildTasks from './build_tasks.mjs';
import * as packageTasks from './package_tasks.mjs';

const UPSTREAM_URL = 'https://github.com/google/blockly.git';
const UPSTREAM_URL = 'git@github.com:RaspberryPiFoundation/blockly.git';

/**
* Extra paths to include in the gh_pages branch (beyond the normal
* contents of master / develop). Passed to shell unquoted, so can
* contents of main). Passed to shell unquoted, so can
* include globs.
*/
const EXTRAS = [
Expand All @@ -37,7 +37,7 @@ let upstream = null;
function getUpstream() {
if (upstream) return upstream;
for (const line of String(execSync('git remote -v')).split('\n')) {
if (line.includes('google/blockly')) {
if (line.includes('RaspberryPiFoundation/blockly')) {
upstream = line.split('\t')[0];
return upstream;
}
Expand All @@ -47,7 +47,7 @@ function getUpstream() {

/**
* Stash current state, check out the named branch, and sync with
* google/blockly.
* RaspberryPiFoundation/blockly.
*/
function syncBranch(branchName) {
return function(done) {
Expand All @@ -60,19 +60,11 @@ function syncBranch(branchName) {
}

/**
* Stash current state, check out develop, and sync with
* google/blockly.
* Stash current state, check out main, and sync with
* RaspberryPiFoundation/blockly.
*/
export function syncDevelop() {
return syncBranch('develop');
};

/**
* Stash current state, check out master, and sync with
* google/blockly.
*/
export function syncMaster() {
return syncBranch('master');
export function syncMain() {
return syncBranch('main');
};

/**
Expand Down Expand Up @@ -109,10 +101,10 @@ function checkoutBranch(branchName) {

/**
* Create and push an RC branch.
* Note that this pushes to google/blockly.
* Note that this pushes to RaspberryPiFoundation/blockly.
*/
export const createRC = gulp.series(
syncDevelop(),
syncMain(),
function(done) {
const branchName = getRCBranchName();
execSync(`git switch -C ${branchName}`, { stdio: 'inherit' });
Expand All @@ -136,12 +128,12 @@ export function pushRebuildBranch(done) {
const branchName = getRebuildBranchName();
execSync(`git push origin ${branchName}`, { stdio: 'inherit' });
console.log(`Branch ${branchName} pushed to GitHub.`);
console.log('Next step: create a pull request against develop.');
console.log('Next step: create a pull request against main.');
done();
}

/**
* Update github pages with what is currently in develop.
* Update github pages with what is currently in main.
*
* Prerequisites (invoked): clean, build.
*/
Expand All @@ -150,7 +142,7 @@ export const updateGithubPages = gulp.series(
execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' });
execSync('git switch -C gh-pages', { stdio: 'inherit' });
execSync(`git fetch ${getUpstream()}`, { stdio: 'inherit' });
execSync(`git reset --hard ${getUpstream()}/develop`, { stdio: 'inherit' });
execSync(`git reset --hard ${getUpstream()}/main`, { stdio: 'inherit' });
done();
},
buildTasks.cleanBuildDir,
Expand Down
2 changes: 1 addition & 1 deletion packages/blockly/scripts/gulpfiles/release_tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const publishBeta = gulp.series(
// Switch to a new branch, update the version number, build Blockly
// and check in the resulting built files.
export const recompile = gulp.series(
gitTasks.syncDevelop(),
gitTasks.syncMain(),
gitTasks.createRebuildBranch,
updateVersionPrompt,
packageTasks.pack, // Does clean + build.
Expand Down