Skip to content

Commit

Permalink
Update to current box version (phar packaging)
Browse files Browse the repository at this point in the history
Current version (2.x) is really old and emitting some
warnings with php >= 8.1. So, just move to current 4.x version.

Simply change to its new incarnation (fork of the original) and
tidy up a few parameters.

Note that the phar still has a good number of limitations:
- Not all checks work (phpcs, behat...).
- Cannot post-install moodle-local_ci (vnu.jar)
- ...

But all those are pre-existing and this new version does
not change that.

Note that box requires PHP 8.1 to build the phar, but the
phar works perfectly with PHP 7.4 (our min requirement).

Fixes moodlehq#235
  • Loading branch information
stronk7 committed Sep 7, 2023
1 parent 225a511 commit 3e5746e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup PHP 7.4
- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
ini-values: phar.readonly = false

- name: Build PHAR
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ ifeq (, $(wildcard vendor))
endif

build/box.phar:
@cd build && curl -LSs https://box-project.github.io/box2/installer.php | php
curl -LSs https://github.com/box-project/box/releases/download/4.3.8/box.phar -o build/box.phar

build/moodle-plugin-ci.phar: build/box.phar
$(COMPOSER) install --no-dev --prefer-dist --classmap-authoritative --quiet
php -d memory_limit=-1 -d phar.readonly=false build/box.phar build
php -d memory_limit=-1 -d phar.readonly=false build/box.phar compile
$(COMPOSER) install --prefer-dist --quiet

docs/CLI.md: $(CMDS)
Expand Down
9 changes: 3 additions & 6 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"chmod": "0755",
"compression": "GZ",
"directories": [
"src",
Expand Down Expand Up @@ -39,13 +38,11 @@
]
}
],
"compactors": "Herrera\\Box\\Compactor\\Php",
"compactors": "KevinGH\\Box\\Compactor\\Php",
"git-version": "package_version",
"replacements": {
"is_boxed": "BOXED"
},
"intercept": true,
"main": "bin/moodle-plugin-ci",
"output": "build/moodle-plugin-ci.phar",
"stub": true
}
"output": "build/moodle-plugin-ci.phar"
}

0 comments on commit 3e5746e

Please sign in to comment.