Skip to content

ci: build PHAR + SHA256 sum on every v* tag#14

Merged
math3usmartins merged 1 commit into
mainfrom
ci/build-phar
Jun 3, 2026
Merged

ci: build PHAR + SHA256 sum on every v* tag#14
math3usmartins merged 1 commit into
mainfrom
ci/build-phar

Conversation

@math3usmartins

Copy link
Copy Markdown
Member

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.

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>
@math3usmartins math3usmartins merged commit d3335fc into main Jun 3, 2026
2 checks passed
@math3usmartins math3usmartins deleted the ci/build-phar branch June 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant