ci(release): modernize release.sh + add tag-triggered GitHub Release workflow#83
Merged
Merged
Conversation
…workflow
Tier 1 release-pipeline modernization for kyte-php (mirrors what we
did for kyte-api-js, scoped to kyte-php's composer-only distribution).
Two changes:
1) release.sh — fix + harden
The old script tried to read src/Core/Version.php for hardcoded
MAJOR/MINOR/PATCH constants. Those were removed in v4.3.2 when
Version.php was rewritten to read from Composer's runtime data
(Composer\InstalledVersions::getPrettyVersion). The script has
been silently broken since then — every release after v4.3.2,
including v4.4.0 just shipped, bypassed it and used git tag
directly. This rewrite drops the dead Version.php check and adds
pre-flight gates:
- CHANGELOG.md top matches the version arg (kept from original)
- Working tree clean (would otherwise tag unintended state)
- Current branch is master (releases off master only)
- Local master in sync with origin (no stale tags)
- Tag doesn't already exist locally OR upstream
set -e added so any failed git command aborts rather than
continuing with a half-baked release.
2) .github/workflows/release.yml — new
Tag push (v*) triggers an Actions job that:
- Extracts the version from the tag ref
- Verifies a matching `## <version>` header exists in CHANGELOG.md
(fails loud — refuses to publish an empty release)
- Extracts the section between that header and the next `## ` as
release notes
- Creates a GitHub Release with the notes
No S3 / CDN upload — kyte-php is composer-distributed, Packagist
auto-detects new tags from GitHub within minutes of the release.
That's why this workflow is materially smaller than kyte-api-js's
deploy.yml.
Belt-and-suspenders: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true
env var so action-gh-release runs on Node 24 ahead of GitHub's
2026-06-02 force-migration (same fix we applied to kyte-api-js).
After this lands, the v4.4.1 / v4.5.0 / etc. release flow becomes:
1. Land work on master with a CHANGELOG entry
2. ./release.sh X.Y.Z (pre-flight + tag + push)
3. GitHub Release auto-created from CHANGELOG section
4. Packagist picks up the tag, customers composer update to pull
release-please for kyte-php is deferred (filed as Tempo card —
release cadence is slow enough that manual CHANGELOG management
remains acceptable, and the no-version-field-in-composer.json
quirk makes release-please integration messier than for kyte-api-js).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier 1 release-pipeline modernization for kyte-php. Same shape as the kyte-api-js work, scoped to kyte-php's composer-only distribution (no CDN deploy step needed).
What's in here
release.sh — fix + harden
The old release.sh was silently broken since v4.3.2. It tried to read
src/Core/Version.phpfor hardcodedMAJOR/MINOR/PATCHconstants that were removed in v4.3.2 whenVersion.phpwas rewritten to read from Composer's runtime data. Every release after v4.3.2 — including v4.4.0 yesterday — bypassed it and usedgit tagdirectly.Rewrite drops the dead Version.php check and adds pre-flight gates that match the kyte-api-js script:
.github/workflows/release.yml— newTag push (
v*) triggers GitHub Actions to:## <version>header exists in CHANGELOG.md (refuse to publish empty release notes)softprops/action-gh-release@v2No S3 / CDN upload — Packagist auto-detects new tags from GitHub within minutes. This workflow is much smaller than kyte-api-js's
deploy.ymlfor that reason.Includes
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=truebelt-and-suspenders for the June 2 force-migration.What's NOT in here
version-field-in-composer.jsonquirk makes release-please'sphprelease-type integration messier than for kyte-api-js. Worth doing eventually if cadence picks up.New release flow after merge
Test plan
🤖 Generated with Claude Code