ci: build PHAR + SHA256 sum on every v* tag#14
Merged
Conversation
Adds a self-contained PHAR distribution channel alongside the Packagist library publish. Non-Composer consumers (CI scripts, Docker images, ops plumbing) can now `curl` xphp.phar and run it with stock PHP, no vendor/ to provision. Three pieces: - box.json (new, repo root). Minimal Humbug Box config -- main, output, compression, banner. Box auto-discovers sources from composer.json so no directories/files overrides are needed. - Makefile `build/phar` target. Strips dev deps, lazily downloads box.phar 4.6.6 into var/, compiles dist/xphp.phar, then restores the dev install so the next `make test/unit` keeps working without a separate composer install step. Box version is pinned so a new release can't silently break the build. - .github/workflows/release.yml. Triggers on `push: tags: ['v*']`. Builds the PHAR, smoke-tests with `php dist/xphp.phar list` (so a broken PHAR fails before upload), computes SHA256, and attaches both `xphp.phar` and `xphp.phar.sha256sum` to the GitHub Release via softprops/action-gh-release@v2. Verified locally inside the docker compose php service: produces a 627 KB PHAR (545 files), `list` exits zero, `compile --help` prints the expected three-arg signature, and the SHA256 round- trips via `sha256sum -c`. `.gitignore` already covers `/dist/` and `/var/` so the produced PHAR and the downloaded Box binary are excluded -- no edit needed. 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.
Adds a self-contained PHAR distribution channel alongside the Packagist library publish. Non-Composer consumers (CI scripts, Docker images, ops plumbing) can now
curlxphp.phar and run it with stock PHP, no vendor/ to provision.Three pieces:
box.json (new, repo root). Minimal Humbug Box config -- main, output, compression, banner. Box auto-discovers sources from composer.json so no directories/files overrides are needed.
Makefile
build/phartarget. Strips dev deps, lazily downloads box.phar 4.6.6 into var/, compiles dist/xphp.phar, then restores the dev install so the nextmake test/unitkeeps working without a separate composer install step. Box version is pinned so a new release can't silently break the build..github/workflows/release.yml. Triggers on
push: tags: ['v*']. Builds the PHAR, smoke-tests withphp dist/xphp.phar list(so a broken PHAR fails before upload), computes SHA256, and attaches bothxphp.pharandxphp.phar.sha256sumto the GitHub Release via softprops/action-gh-release@v2.Verified locally inside the docker compose php service: produces a 627 KB PHAR (545 files),
listexits zero,compile --helpprints the expected three-arg signature, and the SHA256 round- trips viasha256sum -c..gitignorealready covers/dist/and/var/so the produced PHAR and the downloaded Box binary are excluded -- no edit needed.