Skip to content

Port WP Job Manager release tooling to WP Super Cache#1069

Open
donnchawp wants to merge 3 commits into
trunkfrom
release-tooling-port
Open

Port WP Job Manager release tooling to WP Super Cache#1069
donnchawp wants to merge 3 commits into
trunkfrom
release-tooling-port

Conversation

@donnchawp

Copy link
Copy Markdown
Contributor

Summary

Adopts WP Job Manager's two-phase, CI-deployed release model so WP Super Cache releases the same way:

  1. make release VERSION=x.y.z (local) — creates a release/wp-super-cache-x.y.z branch, bumps Version:/Stable tag:, assembles the changelog from the GitHub milestone x.y.z (each merged PR's ### Release Notes section, falling back to the PR title), and opens a PR whose body holds the changelog editable between the two --- lines.
  2. On merge.github/workflows/create-release.yml runs scripts/create-release.mjs, which writes the edited notes into readme.txt's == Changelog ==, tags, builds the zip, creates the GitHub release, and deploys to WordPress.org SVN via the 10up action.

This retires the manual pre-buildbuildpublish pipeline.

Config-driven, per the shared design

The orchestrator scripts are intended to stay identical across plugins; per-repo specifics live in release.config.json:

  • versionConstant: null — WPSC defines WPSC_VERSION_ID (an internal cache/config version, decoupled from the plugin version), so there is no release-version constant to bump.
  • bumpPackageJson: falsepackage.json's 4.0.0-alpha / @automattic/jetpack-super-cache is a Jetpack-monorepo leftover unrelated to the plugin version.
  • Build/i18n are delegated to make build (emits build/wp-super-cache.zip) and make i18n (a no-op — WPSC translations come from translate.wordpress.org).

Notable changes

  • scripts/build-plugin.sh made non-interactive / CI-safe (dropped the branch/clean-tree guards and the "have you merged?" prompt that would hang the runner).
  • Deploy workflow uses npm install, not npm cipackage-lock.json is gitignored in this repo.
  • readme.txt is the single changelog; removed the "See previous releases on GitHub" footer.

Before the first release

  • Add repo secrets WORDPRESSORG_SVN_USERNAME / WORDPRESSORG_SVN_PASSWORD.
  • Create a GitHub milestone named exactly x.y.z and assign the release's PRs to it.

Merging this PR does not trigger a release — the workflow only fires for release/* branches.

Verification

  • node --check on both scripts; prepare-release.mjs exits correctly with no VERSION.
  • make build produces the zip and correctly excludes release.config.json, scripts/, .github/.
  • updateChangelog() dry-run against readme.txt: 5 trimmed ### version entries, no leftover divider, trailing newline preserved.

https://claude.ai/code/session_01CZWPVHhcZmaVPRC1ARiVyf

donnchawp added 3 commits July 4, 2026 11:02
Adopts the two-phase, CI-deployed release model: `make release VERSION=x.y.z`
opens a PR with an editable changelog; merging it runs a GitHub Action that
writes the changelog into readme.txt, tags, builds the zip, and deploys to
WordPress.org SVN.

- Add config-driven prepare-release.mjs / create-release.mjs (read
  release.config.json; shell out to `make build` / `make i18n`).
- release.config.json: slug wp-super-cache, main file wp-cache.php, no version
  constant (WPSC_VERSION_ID is an unrelated internal version), no package.json
  bump (its version is a Jetpack-monorepo leftover).
- create-release.yml deploys on merge of release/* PRs via the 10up action,
  using WORDPRESSORG_SVN_* repo secrets. Uses npm install (lockfile is gitignored).
- Make build-plugin.sh non-interactive/CI-safe; add `release` and `i18n`
  (no-op) Make targets; retire the manual pre-build/publish scripts.
- readme.txt is the single changelog; drop the "See previous releases" footer.

First live release is deliberate/supervised (not triggered by this PR, whose
branch is not release/*).

Claude-Session: https://claude.ai/code/session_01CZWPVHhcZmaVPRC1ARiVyf
Release confirmations are enabled on wp.org, so a merged release is pushed to
SVN but held pending email confirmation rather than published immediately.
Reword the post-deploy comment from "deployed" to "pushed … confirm to publish"
so the PR doesn't imply the release is already live.

Claude-Session: https://claude.ai/code/session_01CZWPVHhcZmaVPRC1ARiVyf
Apply the guarded shared release script (see RELEASE_TOOLING_CONCERNS.md):
- getReleaseNotes() null-checks the `### Release Notes` / `---` fences and
  throws an explicit error instead of a cryptic null dereference (Concern 3).
- Every mutating step is idempotent and safe to re-run (Concern 2): skip the
  changelog if the version entry exists; commit only if staged; tag only if
  absent on the remote; create the GitHub release only if absent; short-circuit
  to exit 0 (emitting the version) if the tag + release already exist.
- Changelog writer is now section-bounded (stops at the next `== ... ==`), and
  the build dir is config-driven (buildDir, default "build").

Keeps this repo's create-release.mjs identical to the rest of the family.

Claude-Session: https://claude.ai/code/session_01CZWPVHhcZmaVPRC1ARiVyf
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