Build and release

Last updatedView as Markdown

bash scripts/build.sh is the only supported way to produce the distributable. The release workflow, Plugin Check, and a local developer all run that script.

Build the zip

Prerequisites on PATH: npm, composer, zip, rsync, php. If node_modules is missing, the script runs npm ci.

  1. Build JavaScript

    npm run build writes build/admin.js and build/admin.asset.php.

  2. Install runtime Composer dependencies

    composer install --no-dev --optimize-autoloader. Outside CI the script restores development dependencies at the end.

  3. Copy the allow-list

    rsync each item through .distignore into build/plugin-scaffold/.

  4. Assert required and forbidden paths

    Missing runtime files fail the build. node_modules, .npmrc, auth.json, .git, src, tests, and overlays must not appear in the output.

  5. Compare versions and zip

    The plugin header Version must match .release-please-manifest.json. Then build/plugin-scaffold.zip is created.

Build the distributable bash
bash scripts/build.sh

Copy list

Reference

scripts/build.sh copy_list

Each path is skipped with a warning when missing, except the later required-file assertions.
8 fields
plugin-scaffold.php string required
Main plugin file. Also required in the output.
uninstall.php string required
Uninstall file. Also required in the output.
includes string required
PHP classes. Bootstrap.php is required in the output.
languages string
Text domain path. Present as languages/index.php.
vendor string required
Runtime autoloader. vendor/autoload.php is required.
composer.json string
Copied into the zip. composer.lock is in .distignore.
LICENSE string
GPL-2.0 text.
README.md string
Copied into the zip.

Optional extras the script copies when present:

  • Root build/ into the package build/ (excluding the package directory and zip)
  • readme.txt (WordPress.org overlay), with release-please marker lines stripped
  • blocks/build into blocks/build (blocks overlay)

Required files after copy: plugin-scaffold.php, uninstall.php, includes/Core/Bootstrap.php, vendor/autoload.php, build/admin.js, build/admin.asset.php. The packaged autoloader must resolve Linchpin\Plugin_Scaffold\Core\Bootstrap.

.distignore is the second exclusion layer. It lists development paths including /src, /tests, /docs, /overlays, and /scripts.

Release

release-please-config.json uses release-type: php for the . package named plugin-scaffold. Extra files that receive the version: plugin-scaffold.php, README.md, .release-please-manifest.json, and package.json $.version. Tags include v and do not include the component name.

.github/workflows/release-please.yml on main:

  1. googleapis/release-please-action@v5 with secrets.GH_BOT_TOKEN
  2. On release_created, run Plugin Check
  3. On success, run bash scripts/build.sh and attach build/plugin-scaffold.zip to the tag as plugin-scaffold.zip

Current manifest version: 0.1.0. CHANGELOG.md records that as the initial house standard.

Have a question about this page?

Linchpin assistant

Was this helpful?