Skip to content

Commit

Permalink
Upgrade to Box 3 for Phar generation
Browse files Browse the repository at this point in the history
Box 2 is no longer maintained and will not be made compatible with more recent PHP versions.

Refs:
* https://github.com/box-project/box/blob/master/UPGRADE.md#from-27-to-30
* https://github.com/box-project/box/blob/master/doc/configuration.md
  • Loading branch information
jrfnl committed Dec 1, 2021
1 parent 710e2e9 commit 2dc7c7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 5.4
php-version: 7.3
extensions: exif, phar, openssl
coverage: none
ini-values: phar.readonly=Off

- name: Install Box from GitHub
run: |
curl -LSs https://box-project.github.io/box2/installer.php | php
test -f ./box.phar
test -d ~/bin || mkdir ~/bin
mv ./box.phar ~/bin/box
~/bin/box -V
echo "$HOME/bin" >> $GITHUB_PATH
- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--no-dev"

- name: Install Box
run: wget https://github.com/humbug/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd

- name: Validate configuration
run: php box.phar validate -i box.json

- name: Building binary...
run: box build -v
run: php box.phar compile -v --config=box.json

- name: Show info about the build phar with humbug/box
run: php box.phar info -l parallel-lint.phar

- uses: actions/upload-artifact@v2
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 5.4
php-version: 7.3
extensions: exif, phar, openssl
coverage: none
ini-values: phar.readonly=Off, error_reporting=E_ALL, display_errors=On

- name: Install Box from GitHub
run: |
curl -LSs https://box-project.github.io/box2/installer.php | php
test -f ./box.phar
test -d ~/bin || mkdir ~/bin
mv ./box.phar ~/bin/box
~/bin/box -V
echo "$HOME/bin" >> $GITHUB_PATH
- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--no-dev"

- name: Install Box
run: wget https://github.com/humbug/box/releases/latest/download/box.phar -O box.phar && chmod 0755 box.phar && pwd

- name: Validate configuration
run: php box.phar validate -i box.json

- name: Building binary...
run: box build -v
run: php box.phar compile -v --config=box.json

- name: Show info about the build phar with humbug/box
run: php box.phar info -l parallel-lint.phar

- uses: actions/upload-artifact@v2
with:
Expand Down
18 changes: 7 additions & 11 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"base-path": null,
"output": "parallel-lint.phar",
"chmod": "0755",
"compactors": [
"Herrera\\Box\\Compactor\\Php"
"KevinGH\\Box\\Compactor\\Php"
],
"extract": false,
"main": "parallel-lint",
"directories": [
"bin",
"src"
],
"files": [
"LICENSE"
],
Expand All @@ -14,15 +18,7 @@
"name": ["*.php"],
"exclude": ["Tests", "tests"],
"in": "vendor"
},
{
"exclude": ["Tests"],
"in": "src"
},
{
"in": "bin"
}
],
"stub": true,
"web": false
"stub": true
}

0 comments on commit 2dc7c7c

Please sign in to comment.