Skip to content

Commit 49726a4

Browse files
Fix failing WP update workflows (#2376)
## Motivation for the change, related issues Our automation that updates WordPress builds is currently broken. The workflows try to run Playground CLI with bun, and that is not currently working (due to broken worker URL resolution at runtime). ## Implementation details This PR adjusts the build script and the workflows to use Node.js instead of Bun. It also fixes a couple other small bugs: 1. The Playground CLI Nx targets `unbuilt-asyncify` and `unbuilt-jspi` were mistakenly passing the `--watch` argument to node. My intent with those targets was for them to be easy ways to run Playground CLI once. 2. The WP build script were exiting with an error if the beta version was specified but a beta version wasn't available. Sometimes beta versions aren't available, so now we exit normally in that case. ## Testing Instructions (or ideally a Blueprint) - CI - Deploy - Test workflows on trunk These workflows are already broken, so I'm just going merge and see if they work in production. If there are further issues, I'll open another PR and do the slower kind of testing that involves commenting out only-on-main-branch guards and temporarily adding exceptions to branch protections.
1 parent 4a9e32e commit 49726a4

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.github/workflows/refresh-wordpress-major-and-beta.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ jobs:
3636
clean: true
3737
persist-credentials: true
3838
submodules: true
39-
- name: 'Install bun'
40-
run: |
41-
curl -fsSL https://bun.sh/install | bash
4239
- uses: ./.github/actions/prepare-playground
4340
with:
4441
node-version: 23
@@ -47,7 +44,7 @@ jobs:
4744
shell: bash
4845
env:
4946
FORCE_REBUILD: ${{ github.event.inputs.force_rebuild }}
50-
run: PATH="${PATH}:${HOME}/.bun/bin" npx nx bundle-wordpress:major-and-beta playground-wordpress-builds
47+
run: npx nx bundle-wordpress:major-and-beta playground-wordpress-builds
5148
- name: Check for uncommitted changes
5249
id: changes
5350
run: |

.github/workflows/refresh-wordpress-nightly.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,9 @@ jobs:
3232
- uses: ./.github/actions/prepare-playground
3333
with:
3434
node-version: 23
35-
- name: 'Install bun'
36-
run: |
37-
curl -fsSL https://bun.sh/install | bash
3835
- name: 'Recompile WordPress'
3936
shell: bash
40-
run: PATH="${PATH}:${HOME}/.bun/bin" npx nx bundle-wordpress:nightly playground-wordpress-builds
37+
run: npx nx bundle-wordpress:nightly playground-wordpress-builds
4138
- name: Config git user
4239
run: |
4340
git config --global user.name "deployment_bot"

packages/playground/cli/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"command": "node -e \"if (parseInt(process.versions.node) < 22) { console.error('Node.js version 22 or greater is required'); process.exit(1); }\"",
9393
"forwardAllArgs": false
9494
},
95-
"node --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts"
95+
"node --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts"
9696
],
9797
"tty": true,
9898
"parallel": false
@@ -106,7 +106,7 @@
106106
"command": "node -e \"if (parseInt(process.versions.node) < 23) { console.error('Node.js version 23 or greater is required for JSPI support'); process.exit(1); }\"",
107107
"forwardAllArgs": false
108108
},
109-
"node --experimental-wasm-jspi --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts --watch ./packages/playground/cli/src/cli.ts"
109+
"node --experimental-wasm-jspi --experimental-strip-types --experimental-transform-types --disable-warning=ExperimentalWarning --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts"
110110
],
111111
"tty": true,
112112
"parallel": false

packages/playground/wordpress-builds/build/build.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ if (args.wpVersion === 'nightly') {
111111
}
112112

113113
if (!versionInfo.url) {
114+
if (args.wpVersion === 'beta') {
115+
process.stdout.write('Skipping. We did not find a WP beta version.\n');
116+
process.exit(0);
117+
}
118+
114119
process.stdout.write(`WP version ${args.wpVersion} is not supported\n`);
115120
process.stdout.write(await parser.getHelp());
116121
process.exit(1);
@@ -154,9 +159,12 @@ try {
154159
await fs.mkdir(wordpressDir);
155160
// Install WordPress in a local directory
156161
await asyncSpawn(
157-
'bun',
162+
'npx',
158163
[
159-
'../../cli/src/cli.ts',
164+
'nx',
165+
'unbuilt-jspi',
166+
'playground-cli',
167+
'--',
160168
'run-blueprint',
161169
`--wp=${versionInfo.url}`,
162170
`--mount-before-install=${wordpressDir}:/wordpress`,

0 commit comments

Comments
 (0)