Add WASM extension artifact publishing workflow#396
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Builds a Playground-loadable
wp_mysql_parserWASM PHP extension bundle for PHP8.0through8.5.On
trunkpushes or manualworkflow_dispatch, the new publish workflow:wp_mysql_parser-wasm-extension.gh-pagesbranch:The
latest/path is replaced on every publish. The<commit-sha>/path is immutable.Rationale
Playground needs public
manifest.jsonand.sofiles it can fetch at runtime. An Actions artifact is useful for debugging, but it is not a stable public URL and should not be treated as a production plugin release.Publishing the bundle from
gh-pagesgives Playground a static URL without repackaging the WordPress plugin itself. The repository still needs GitHub Pages configured to publish from thegh-pagesbranch root before these URLs resolve:PHP
7.4is intentionally excluded. The Rust path usesext-php-rs0.15, which depends on PHP 8 Zend APIs.Implementation
Adds
.github/workflows/publish-wasm-extension-artifact.ymlwith a serialized PHP matrix for8.5,8.4,8.3,8.2,8.1, and8.0. The package job downloads the per-version.soartifacts, writes a combined Playground extension manifest, writesSHA256SUMS, uploads the bundle, then commits the static bundle togh-pages.The manifest follows the WordPress Playground extension format from WordPress/wordpress-playground#3580:
{ "name": "wp_mysql_parser", "mode": "php-extension", "artifacts": [ { "phpVersion": "8.4", "sourcePath": "wp_mysql_parser-php8.4-jspi.so" } ] }The manifest uses
sourcePathand does not include the retiredfileorsha256artifact fields. Checksums are published separately inSHA256SUMS.The Rust build now runs the published
@php-wasm/compile-extension@3.1.27CLI from an isolated temporary npm prefix. A sparseWordPress/wordpress-playgroundcheckout is still required forpackages/php-wasm/compileDocker assets and for the Playground load smoke test.Follow-up for Playground: make
@php-wasm/compile-extensionself-contained so external extension projects do not need to shallow or sparse checkoutWordPress/wordpress-playgroundjust to access Docker assets or test harness files.Testing instructions
Run the local static checks:
Verify the PR
WASM extension buildcheck is green for PHP8.0through8.5. The latest PR run passed all six PHP versions.After merge, run
Publish WASM extension artifactwithworkflow_dispatchor let a matchingtrunkpush trigger it, then verify both published manifests resolve from GitHub Pages once Pages is configured for thegh-pagesbranch root.