Skip to content

Add build-and-distribute workflow - #1

Merged
InpsydeNiklas merged 1 commit into
dev/mainfrom
ci/build-and-distribute
Oct 26, 2026
Merged

InpsydeNiklas merged 1 commit into
dev/mainfrom
ci/build-and-distribute

Conversation

@InpsydeNiklas

Copy link
Copy Markdown
Owner

This moves MultiSyde onto the inpsyde/reusable-workflows build-and-distribute workflow and the dev/main branch model.

What changes

  • Branch model. dev/main holds the source and becomes the default branch. main is generated by CI. Every push to a dev/** branch builds the plugin with composer --no-dev and .distignore. The deploy bot commits the result to the same branch name minus the dev/ prefix, and stamps Version: and SHA: into multisyde.php. The built main has no .github/, so bot pushes start no workflows.
  • Plugin Check on the built output. The new plugin-check-built job downloads the build artifact and runs wordpress/plugin-check-action on it without checking out the source, so it checks exactly what ships. The build changes the code (npm build output, .distignore, --no-dev vendor, header rewrite), so a green source check alone doesn't prove the package passes. Snapshot builds carry a non-release version like 0.0.0+main.<sha>, so plugin_header_invalid_plugin_version and stable_tag_mismatch are ignored in this workflow only. The release workflow checks both strictly.
  • plugin-check.yml (the source check) now runs on PRs and on dev/main.
  • package.json gets the build script the reusable workflow calls.
  • CONTRIBUTING.md points PRs at dev/main.
  • The workflow token is read-only. The deploy bot pushes over SSH.
  • Manual run: Build and distribute with an optional PACKAGE_VERSION. It must be a version Composer accepts, e.g. 1.3.0.

Before merging (repo admin)

  1. Create dev/main from main, make it the default branch, and point this PR at it.
  2. Move branch protection to dev/main. On main, allow pushes from the deploy bot only.
  3. Give the deploy bot write access to the repo. Check that the org secrets DEPLOYBOT_EMAIL, DEPLOYBOT_USER, DEPLOYBOT_SSH_PRIVATE_KEY and DEPLOYBOT_SSH_PUBLIC_KEY are available to inpsyde/multisyde.
  4. Retarget open PRs to dev/main.

After the merge, the first push to dev/main overwrites main with the built plugin.

Tested

All of this ran end to end on a local Gitea with a mirror of inpsyde/reusable-workflows:

  • the build
  • the skip when a commit is already built
  • a manual run with a version
  • dev/* → built branch
  • network activation of the built main in wp-env
  • a negative case where only the built-package check fails: the build emits unescaped PHP, and only plugin-check-built catches it

Only verifiable here on GitHub: version derivation from the latest GitHub Release.

Switch MultiSyde to the inpsyde reusable build-and-distribute workflow
and the dev/main branch model: dev/main holds the source and becomes the
default branch, while main is generated by CI. Every push to a dev/**
branch builds the plugin (composer --no-dev, .distignore applied) and
the deploy bot commits the result to the branch without the dev/ prefix,
stamping Version and the source SHA into the plugin header. The built
main has no .github directory, so bot pushes trigger no workflows.

The build changes what ships, so Plugin Check now also runs on the
built artifact in a plugin-check-built job, not only on the source.
Snapshot builds carry a non-release version that never matches the
readme Stable tag, so those two version codes are ignored there; the
release workflow is meant to check them strictly.

The source Plugin Check now runs on dev/main instead of main, package.json
gets the build script the reusable workflow calls, and CONTRIBUTING
points pull requests at dev/main.
@InpsydeNiklas
InpsydeNiklas merged commit 596e023 into dev/main Oct 26, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
1 0 1

⚠️ Warnings (1)

📁 modules/SiteActivePlugins/Feature.php (1 warning)
📍 Line 🔖 Check 💬 Message
169 WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound Hook names invoked by a theme/plugin should start with the theme/plugin prefix. Found: "self::FILTER_MAX_SITES".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant