Add a GitHub Actions release workflow - #14
Conversation
The PHP release commands depend on a stack that has aged out: swiftmailer 5, ricardoper/twitteroauth, iron_mq, monolog 1.x and aura/di 2.x are all abandoned or EOL, and the tweet and mailing-list code they exist for has been commented out for years. The phpdoc @Package validation targets a phpDocumentor XML template that no longer exists, and .travis.yml is required for a CI service that shut down. Underneath all of it, release3 is eight shell checks and one POST to /releases. Replace it with a reusable workflow that packages call. Opting in is a ~15 line caller in the package; everything else lives here, so fixing the release process for every package is a change to this repo alone. The workflow creates the tag rather than reacting to one. Packagist derives package versions from git tags and never looks at GitHub releases, so a pushed tag is already a published version -- checks that run after a tag push can fail loudly while Composer serves the version they were meant to guard, and the only remedy is deleting a tag that may already be in someone's lock file. Here the version is a dispatch input, the checks run first, and the tag is created last or not at all. It targets the tested commit rather than the branch name, so a push mid-run cannot move it. Release notes are read from the package's own change log; --generate-notes is not used and there is no fallback to it. The version must match the change log's top heading, which may not still be marked unreleased. CHANGELOG.md and CHANGES.md are both accepted, as are version headings at either # or ## level, since the packages are not consistent. The legacy commands are untouched and still work.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Requiring the change log heading to equal the version exactly made pre-releases impossible in practice: a package whose change log heads with '## 6.0.0' could not cut 6.0.0-alpha1, because the heading did not match. That rules out the safest way to exercise the whole pipeline -- publish included -- without committing to a final version. A pre-release now matches either its own version or the base version it leads up to, so 6.0.0-alpha1, -beta1 and -RC1 all release against a '## 6.0.0' section. A final release still demands an exact match. The '(unreleased)' marker is relaxed the same way, and for the same reason: it means the final version is not out yet, which is exactly true while cutting pre-releases of it. It still blocks a final release.
|
Pushed 008270f: pre-releases can now run against the section they lead up to. The strict heading equality made pre-releases impossible in practice — Aura.Html's change log heads with Now:
Re-verified against the real change logs:
|
008270f to
c844016
Compare
Releasing becomes: Actions -> Release -> pick the branch and type the version. The shared workflow in auraphp/bin runs the checks, takes the release notes from this package's CHANGELOG.md, and creates the tag only if everything passed. Do not tag by hand. Packagist derives package versions from git tags and never looks at GitHub releases, so a pushed tag is already a published version. Pinned to the auraphp/bin branch while auraphp/bin#14 is open; switch to @master once that merges.
Replaces the PHP release commands with a reusable GitHub Actions workflow that packages call. Opting in is a ~15 line caller file; the checks, change log parsing and publish live here, so the release process for every package is fixed in one place.
Releasing: Actions → Release → pick the branch, type the version.
Why
release3is eight shell checks and onePOST /releases, wrapped in swiftmailer 5, twitteroauth, iron_mq, monolog 1.x and aura/di 2.x — all abandoned or EOL, for tweet and mail code that has been commented out for years. The phpdoc@packagevalidation targets a phpDocumentor XML template that no longer exists;.travis.ymlis required for a dead service.The decision worth reviewing
The workflow creates the tag; the tag does not trigger the workflow.
Packagist derives versions from git tags and never looks at GitHub releases, so a pushed tag is already published. A workflow triggered on a tag push can only fail after the fact, while Composer serves the version its checks were meant to guard. Here the version is a dispatch input, checks run first, and the tag is created last or not at all — targeting the tested commit, not the branch name.
Notes come from the change log
--generate-notesis not used, no fallback. The version must match the change log's top heading.CHANGELOG.md/CHANGES.mdand#/##headings all work.Pre-releases match either their own version or the base they lead up to, so
6.0.0-alpha1releases against a## 6.0.0section,(unreleased)marker and all. A final release demands an exact match with the marker gone.Verified against the real change logs
## 6.0.06.0.0## 6.0.06.0.0-alpha1/-beta1/-RC1## 6.0.05.0.0## 6.0.06.0.0###subheads kept# 3.4.2(CHANGES.md)3.4.2## 6.0.0 (unreleased)6.0.0-alpha1## 6.0.0 (unreleased)6.0.0Not yet run on GitHub
auraphp/Aura.Html#75 adopts it, pinned to this branch. Merge that after this, then switch its
uses:to@master.workflow_dispatchonly registers from a package's default branch; releasing an older line needs the caller on that branch too.