Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh WordPress with the latest SQLite integration plugin #1151

Merged
merged 1 commit into from
Mar 29, 2024
Merged
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
7 changes: 7 additions & 0 deletions .github/workflows/refresh-wordpress-major-and-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Refresh WordPress Major&Beta'

on:
workflow_dispatch:
inputs:
force_rebuild:
description: 'Force rebuild of WordPress (true/false)'
required: false
default: 'false'
# Every 20 minutes
schedule:
- cron: '*/20 * * * *'
Expand Down Expand Up @@ -32,6 +37,8 @@ jobs:
- uses: ./.github/actions/prepare-playground
- name: 'Recompile WordPress'
shell: bash
env:
FORCE_REBUILD: ${{ github.event.inputs.force_rebuild }}
run: npx nx bundle-wordpress:major-and-beta playground-wordpress
- name: Check for uncommitted changes
id: changes
Expand Down
21 changes: 9 additions & 12 deletions packages/playground/wordpress/build/build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import path from 'path';
import { spawn } from 'child_process';
import yargs from 'yargs';
import { promises as fs, statSync } from 'fs';

const parser = yargs(process.argv.slice(2))
.usage('Usage: $0 [options]')
.options({
Expand All @@ -22,6 +22,11 @@ const parser = yargs(process.argv.slice(2))
description: 'WordPress static files output directory',
required: true,
},
force: {
type: 'boolean',
description: 'Force rebuild even if the version is already downloaded',
default: process.env.FORCE_REBUILD === 'true',
},
});

const args = parser.argv;
Expand Down Expand Up @@ -83,7 +88,7 @@ const sourceDir = path.dirname(new URL(import.meta.url).pathname);
const outputAssetsDir = path.resolve(process.cwd(), args.outputAssets);
const outputJsDir = path.resolve(process.cwd(), args.outputJs);

// Short-circuit if the version is already downloaded
// Short-circuit if the version is already downloaded and not forced
const versionsPath = `${outputJsDir}/wp-versions.json`;
let versions = {};
try {
Expand All @@ -95,15 +100,11 @@ try {
versions = {};
}

// We don't get granular version info for nightly, so we always download it.
// Otherwise, we only download if the version is not already the latest one
// in the repository.
if (versionInfo.slug !== 'nightly' && versions[versionInfo.slug] === versionInfo.version) {
process.stdout.write(`The requested version was ${args.wpVersion}, but it's latest release (${versionInfo.version}) is already downloaded\n`);
if (!args.force && versionInfo.slug !== 'nightly' && versions[versionInfo.slug] === versionInfo.version) {
process.stdout.write(`The requested version was ${args.wpVersion}, but its latest release (${versionInfo.version}) is already downloaded\n`);
process.exit(0);
}


// Build WordPress
await asyncSpawn(
'docker',
Expand Down Expand Up @@ -131,8 +132,6 @@ await asyncSpawn(
'-v',
`${outputAssetsDir}:/output`,
'wordpress-playground',
// Use sh -c because wildcards are a shell feature and
// they don't work without running cp through shell.
'sh',
'-c',
`cp -r /root/output/wp-${versionInfo.slug} /output/`,
Expand All @@ -151,8 +150,6 @@ await asyncSpawn(
'-v',
`${outputJsDir}:/output`,
'wordpress-playground',
// Use sh -c because wildcards are a shell feature and
// they don't work without running cp through shell.
'sh',
'-c',
`cp /root/output/*.zip /output/`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,35 @@ export function getWordPressModuleDetails(wpVersion: string = "6.4"): { size: nu
case 'beta':
/** @ts-ignore */
return {
size: 5127315,
size: 5127314,
url: url_beta,
};

case '6.4':
/** @ts-ignore */
return {
size: 5015127,
size: 5015110,
url: url_6_4,
};

case '6.3':
/** @ts-ignore */
return {
size: 3760149,
size: 3760135,
url: url_6_3,
};

case '6.2':
/** @ts-ignore */
return {
size: 3654394,
size: 3654384,
url: url_6_2,
};

case '6.1':
/** @ts-ignore */
return {
size: 3533948,
size: 3533940,
url: url_6_1,
};

Expand Down
Binary file modified packages/playground/wordpress/src/wordpress/wp-6.1.zip
Binary file not shown.
Binary file modified packages/playground/wordpress/src/wordpress/wp-6.2.zip
Binary file not shown.
Binary file modified packages/playground/wordpress/src/wordpress/wp-6.3.zip
Binary file not shown.
Binary file modified packages/playground/wordpress/src/wordpress/wp-6.4.zip
Binary file not shown.
Binary file modified packages/playground/wordpress/src/wordpress/wp-beta.zip
Binary file not shown.
Loading