From 79f81c856cbe10dba0692570441869f41979763d Mon Sep 17 00:00:00 2001 From: Laurent Laville Date: Fri, 5 Jul 2024 14:06:56 +0000 Subject: [PATCH] fix issue #210 : phar manifest is broken --- .github/workflows/release.yml | 19 ++++++++++++++----- box.json | 15 +++++++++++++++ box.json.dist | 8 +++++++- 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 box.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b25d53e9..88c99fc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,11 +48,20 @@ jobs: with: composer-options: "--prefer-dist" - - # https://github.com/box-project/box - name: Build Release Artifacts - run: | - box compile - box info ${{ github.workspace }}/bin/phplint.phar + - # https://github.com/llaville/box-manifest + name: Download BOX Manifest Artifact + run: | + curl -Ls https://github.com/llaville/box-manifest/releases/latest/download/box-manifest.phar -o /usr/local/bin/box-manifest + chmod +x /usr/local/bin/box-manifest + + - # https://github.com/llaville/box-manifest + name: Build Release Artifact + run: | + box-manifest manifest:build --ansi -vv -c box.json --output-file=sbom.json + box-manifest manifest:build --ansi -vv -c box.json --output-file=console.txt --format console + box-manifest manifest:stub --ansi -vv -c box.json --output-file=stub.php --resource console.txt --resource sbom.json + box compile --ansi -vv -c box.json.dist + box info ${{ github.workspace }}/bin/phplint.phar - # https://github.com/softprops/action-gh-release name: Create Release from current tag diff --git a/box.json b/box.json new file mode 100644 index 00000000..c5d8c2d7 --- /dev/null +++ b/box.json @@ -0,0 +1,15 @@ +{ + "compression": "GZ", + "chmod": "0700", + "banner": [ + "This file is part of the overtrue/phplint package", + "", + "(c) overtrue", + "", + "This source file is subject to the MIT license that is bundled", + "with this source code in the file LICENSE." + ], + "force-autodiscovery": true, + "exclude-dev-files": false, + "files": ["autoload.php", "phplint.php"] +} diff --git a/box.json.dist b/box.json.dist index c5d8c2d7..563e4c5f 100644 --- a/box.json.dist +++ b/box.json.dist @@ -11,5 +11,11 @@ ], "force-autodiscovery": true, "exclude-dev-files": false, - "files": ["autoload.php", "phplint.php"] + "files": ["autoload.php", "phplint.php"], + "stub": "stub.php", + "files-bin": ["sbom.json", "console.txt"], + "map": [ + { "console.txt": ".box.manifests/console.txt" }, + { "sbom.json": ".box.manifests/sbom.json" } + ] }