Skip to content

Add release workflow to main (dispatch-only) - #226

Draft
umair-ably wants to merge 1 commit into
mainfrom
pubsub-split/release-workflow-on-main
Draft

Add release workflow to main (dispatch-only)#226
umair-ably wants to merge 1 commit into
mainfrom
pubsub-split/release-workflow-on-main

Conversation

@umair-ably

Copy link
Copy Markdown
Contributor

What

Brings exactly two files from #225 (pubsub-split/release-tooling) onto main:

  • .github/workflows/release.yml — the workflow_dispatch-only release workflow that publishes ably/pubsub-server through the distribution mirror
  • scripts/release-preflight.php — the dependency-free pre-flight it calls

Nothing else from #225 comes with it: no release-dry-run job in check.yml, no CONTRIBUTING.md release section, no .gitattributes export-ignore line. Those belong with the restructured tree, not with the legacy layout on main.

Both files are byte-identical to #225's versions — the diff between the two refs over those paths is empty:

$ git diff origin/pubsub-split/release-tooling -- .github/workflows/release.yml scripts/release-preflight.php
$ echo $?
0

Why

GitHub only registers a workflow_dispatch workflow once its file exists on the repository's default branch. The split work merges to integration/v2 and will not reach main until GA, so without this copy release.yml cannot be dispatched against any ref — not even the branch that defines it. This is plan step 15b, row 3 of the PR stack in step 10b.

Once on main, the workflow becomes dispatchable against any ref that carries the split layout:

gh workflow run release.yml --ref integration/v2 -f version=2.0.0-rc1

That unblocks, in order:

  • the mirror seed — the first dispatch is what creates ably/ably-pubsub-php-dist's history and its first plain <version> tag (plan step 15c);
  • Packagist registration of ably/pubsub-server against the mirror URL, which is what makes the README badges and composer require resolve at all (step 15c);
  • the 2.0.0-rc1 prerelease as a real Packagist install rather than a VCS stanza (step 21), and the deliberate guardrail tests from a throwaway branch (step 15b).

None of those can wait for integration/v2 to merge, which is the whole point of decoupling them.

Inert on main

The workflow has no push or pull_request trigger, so only an explicit dispatch can start it. Dispatched at main, the pre-flight refuses the legacy layout and nothing is pushed:

$ php scripts/release-preflight.php --version 2.0.0 --skip-remote
Release pre-flight for 2.0.0

  ok   no Composer-valid tag at or above 2.0.0 in this repository (21 tag(s) inspected, local only)
  ok   tag pubsub-server/2.0.0 in this repository does not exist yet
  ok   skipped the mirror tag check for ably/ably-pubsub-php-dist (--skip-remote)

4 pre-flight failure(s):
  FAIL Defaults::LIB_VERSION is '1.1.12', expected '2.0.0'
  FAIL the top CHANGELOG.md heading is '1.1.12', expected '2.0.0'
  FAIL composer.json name is 'ably/ably-php', expected 'ably/pubsub-server' — this ref does not carry the ably/pubsub-server package, so there is nothing to release from it
  FAIL composer validate --strict failed:
        ./composer.json is valid, but with a few warnings
        - require.rybakit/msgpack : unbound version constraints (>=0.9.1) should be avoided

Nothing has been pushed. Fix all of the above and dispatch again.

Exit 1. The pre-flight reports every failure rather than aborting on the first, so the decisive one — this ref is not the ably/pubsub-server package — is always in the output even though the version-site mismatches are listed above it. No editing of the script was needed to make the refusal legible here.

Belt and braces beyond the gate: the mirror repository ably/ably-pubsub-php-dist and the MIRROR_PUSH_TOKEN secret do not exist yet, so no publishing step could succeed even if the pre-flight were passed.

For information (the dry-run job is deliberately not added to main), --dry-run on this ref reports version sites agreeing at 1.1.12 and then the same two composer.json failures, exit 1.

actionlint .github/workflows/release.yml is clean, and php -l scripts/release-preflight.php reports no syntax errors.

⚠️ Merge precondition

Per plan step 24, the 1.x maintenance branch (maintenance/1.x, name TBC org-wide) must be cut from the last 1.x release, 1.1.12, before this merges.

For PHP nothing on main actually breaks legacy releases: 1.x publishing is a manual tag-and-release process and Packagist indexes tags, so there is no tag-triggered workflow for this file to displace. The precondition is kept anyway, so the rule is uniform across the SDKs and so a future 1.x fix never has to be untangled from split tooling.

While the branch is being cut, note the tag rule this workflow exists to enforce: 1.x tags must stay plain 1.x.y (the ably/ably-php package is supposed to index them) and 2.x tags must never be plain in this repository — only pubsub-server/<version>, which Composer skips as an invalid version name. #225 sets out why in full: a plain 2.0.0 tag here becomes ably/ably-php version 2.0.0 and is served as latest to every consumer, and deleting the tag afterwards does not undo it.

Keep in sync

If #225 changes either file before it merges, re-copy both here so the two copies cannot drift. The intent is that main's copy is a mirror of #225's, never a fork of it.

Siblings

🤖 Generated with Claude Code

GitHub only registers a `workflow_dispatch` workflow once its file exists
on the repository's default branch. The Pub/Sub split lives on
`integration/v2` until GA, so without this copy `release.yml` cannot be
dispatched against any ref at all — including the first dispatch from
`integration/v2` that seeds the distribution mirror
`ably/ably-pubsub-php-dist` and lets `ably/pubsub-server` be registered on
Packagist against it (plan.md step 15c), and including the `2.0.0-rc1`
prerelease (step 21).

Both files are byte-identical to their versions in #225
(`pubsub-split/release-tooling`): `git diff` between the two refs over
these two paths is empty. Nothing else from that PR comes along — no
`release-dry-run` job in `check.yml`, no CONTRIBUTING release section, no
`.gitattributes` export-ignore line. Those belong with the restructured
tree, not with the legacy layout.

The workflow is inert on this ref. It has no `push` or `pull_request`
trigger, so only an explicit dispatch can start it, and the pre-flight
refuses this layout outright: `composer.json` here is still
`ably/ably-php`, so there is nothing named `ably/pubsub-server` to
release from `main`. The mirror repository and the `MIRROR_PUSH_TOKEN`
secret do not exist yet either, so no publishing step could run even if
the gate were passed.

Implements plan.md steps 15b and 24, row 3 of the PR stack in step 10b.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

umair-ably added a commit that referenced this pull request Sep 9, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant