Repository navigation
Ship desktop PHP binaries via Cloudflare R2 (producer half) - #312
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror php-bin-mobile build.yml: upload zips+sha256 to R2, regenerate versions.json last. Drop create-pull-request binary commits; gitignore new binaries (no history rewrite); keep mac/x86 slot. Contract documented. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Upload to {branch}/desktop/... and write {branch}/desktop/versions.json.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Desktop manifest is fully separate from mobile (own {branch}/desktop/versions.json);
fixes the stale contract note that claimed it wrote to {branch}/versions.json.
- Shared mobile bucket (nativephplibs) + {branch}/desktop/... folder structure confirmed.
- mac-x86 slot kept empty / missing builds ignored; supply-chain signing deferred.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Oct 22, 2026
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.
What
Stops committing the 15 × ~24 MB PHP binary zips into the repo every week and instead publishes them to Cloudflare R2 behind
bin.nativephp.com, with a per-branch manifest the desktop builder downloads on demand. This is the producer half — the CI/build side. The consumer half (the download-on-demand resolver) lands separately innativephp-desktop.Mirrors the existing NativePHP Mobile R2 pipeline (
nativephp-php-bin-mobile→nativephp-mobile-air) and stays backward-compatible with its manifest conventions, while keeping desktop's manifest separate.Why
bin/is 356 MB (15 zips), and.gitis 4.1 GB — ~91% of the repo is history, growing ~0.35 GB/week because the weekly build workflow commits 15 fresh, non-deltifiable zips every Friday.composer require nativephp/php-binand pull the entirebin/tree intovendor/even though a build needs exactly one binary.Changes
build-php-{mac,linux,win}.yml+build-php.ymlorchestrator): after each SPC build,aws s3 cpthe zip and a.sha256sidecar to R2 first; a dependentmanifestjob regeneratesversions.jsonfrom the actual R2 listing and uploads it last — so the manifest can never point at a not-yet-uploaded object.peter-evans/create-pull-requeststep that committed binaries back into git;.gitignore+.gitkeepkeep new zips out of history going forward (no history rewrite in this PR — slim-forward only).generate-versions-json.sh: builds the desktop manifest by listing R2, reading each object's size +.sha256sidecar. Emits the richer{url, sha256, size}entry form; keeps the emptymac-x86slot.docs/r2-binaries-plan.md(research + design) anddocs/r2-binaries-contract.md(the producer→consumer contract: manifest URL, schema, path scheme, secrets).Object layout (shared mobile bucket
nativephplibs, domainbin.nativephp.com)Desktop paths never collide with mobile's
{branch}/{minor}/..., and the desktop manifest is fully separate from mobile's{branch}/versions.json— the two serve different purposes and are not merged.Decisions baked in
{branch}/desktop/versions.json.mac-x86slot kept but empty; missing builds ignored (CI fills R2 on next run).Rollout / status
R2_ACCESS_KEY_ID/R2_SECRET_ACCESS_KEYin repo Actions secrets — added.🤖 Generated with Claude Code