Skip to content

Commit

Permalink
Update to current "box"; enable php scope compactor; add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Dec 5, 2019
1 parent edfe98f commit 06b0345
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 11 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,10 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-dev

- name: Install box2
run: composer global require kherge/box:~2.7

- name: Build PHAR
run: php -d phar.readonly=0 "$HOME/.composer/vendor/bin/box" build -v
run: ./build.sh
continue-on-error: false


- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.idea/
/bin/phpunit
/bin/pogo.phar
/bin/box
/vendor/
.composer-downloads
3 changes: 2 additions & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"finder": [
{
"name": "*.php",
"exclude": ["Tests", "tests", "phpunit"],
"exclude": ["Tests", "tests", "phpunit", "composer-downloads-plugin", "gitignore"],
"in": "vendor"
}
],
"git-version": "package_version",
"main": "bin/pogo",
"compactors": ["KevinGH\\Box\\Compactor\\Php", "KevinGH\\Box\\Compactor\\PhpScoper"],
"output": "bin/pogo.phar",
"stub": true
}
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

## Determine the absolute path of the directory with the file
## usage: absdirname <file-path>
function absdirname() {
pushd $(dirname $0) >> /dev/null
pwd
popd >> /dev/null
}

PRJDIR=$(absdirname "$0")
export PATH="$PRJDIR/bin:$PATH"

set -ex
composer install --prefer-dist --no-progress --no-suggest --no-dev
which box
php -d phar.read_only=0 `which box` build -v
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"require": {
"php": ">=5.6",
"symfony/console": "~3.0|~4.0",
"symfony/yaml": "~3.0|~4.0"
"symfony/yaml": "~3.0|~4.0",
"civicrm/composer-downloads-plugin": "~2.1"
},
"require-dev": {
"phpunit/phpunit": "~5.0"
Expand All @@ -26,5 +27,14 @@
],
"config": {
"bin-dir": "bin"
},
"extra": {
"downloads": {
"box": {
"url": "https://github.com/humbug/box/releases/download/3.8.3/box.phar",
"path": "bin/box",
"type": "phar"
}
}
}
}
86 changes: 85 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06b0345

Please sign in to comment.