From 9cb07382cfbdeb94e276a3cf65180e050a3aa59f Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 16 Feb 2026 10:40:01 -0800 Subject: [PATCH] fix: Fix gulpfiles related to publishing GitHub pages --- packages/blockly/gulpfile.mjs | 12 ------- .../blockly/scripts/gulpfiles/git_tasks.mjs | 34 +++++++------------ .../scripts/gulpfiles/release_tasks.mjs | 2 +- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/packages/blockly/gulpfile.mjs b/packages/blockly/gulpfile.mjs index ad61bcb51..d2784b3a1 100644 --- a/packages/blockly/gulpfile.mjs +++ b/packages/blockly/gulpfile.mjs @@ -35,15 +35,12 @@ import { import {docs} from './scripts/gulpfiles/docs_tasks.mjs'; import { createRC, - syncDevelop, - syncMaster, 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 { generators, @@ -89,12 +86,3 @@ export { createRC as gitCreateRC, docs, } - -// Legacy targets, to be deleted. -// -// prettier-ignore -export { - recompile, - syncDevelop as gitSyncDevelop, - syncMaster as gitSyncMaster, -} diff --git a/packages/blockly/scripts/gulpfiles/git_tasks.mjs b/packages/blockly/scripts/gulpfiles/git_tasks.mjs index 2b08e16b3..3b641691c 100644 --- a/packages/blockly/scripts/gulpfiles/git_tasks.mjs +++ b/packages/blockly/scripts/gulpfiles/git_tasks.mjs @@ -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 = [ @@ -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; } @@ -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) { @@ -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'); }; /** @@ -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' }); @@ -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. */ @@ -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, diff --git a/packages/blockly/scripts/gulpfiles/release_tasks.mjs b/packages/blockly/scripts/gulpfiles/release_tasks.mjs index a678a4f24..3abeba52f 100644 --- a/packages/blockly/scripts/gulpfiles/release_tasks.mjs +++ b/packages/blockly/scripts/gulpfiles/release_tasks.mjs @@ -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.