build.sh 949 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. set -eu
  3. # ensure that deps will work on lowest supported PHP version
  4. composer config platform.php 7.4
  5. # Infection is not compatible with 7.4, and basically not needed in PHAR
  6. composer remove --dev infection/infection --no-update
  7. # install package deps without dev-deps / remove already installed dev-deps
  8. # box can ignore dev-deps, but dev-deps, when installed, may lower version of prod-deps
  9. composer update --optimize-autoloader --no-interaction --no-progress --no-scripts --no-dev
  10. composer info -D | sort
  11. # install box/phar
  12. mkdir -p dev-tools/bin
  13. if [ ! -x dev-tools/bin/box ]; then
  14. wget -O dev-tools/bin/box "https://github.com/box-project/box/releases/download/4.1.0/box.phar"
  15. chmod +x dev-tools/bin/box
  16. fi
  17. dev-tools/bin/box --version
  18. # build phar file
  19. dev-tools/bin/box compile
  20. # revert changes to composer
  21. git checkout composer.json
  22. composer update --optimize-autoloader --no-interaction --no-progress --no-scripts -q