Skip to content

Commit ee93cdd

Browse files
committed
Build PHAR using BOX, deploy tags to GitHub releases
1 parent 95b5c0d commit ee93cdd

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

.gitignore

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
vendor
2-
infection-log.txt
1+
/vendor
2+
/infection-log.txt
3+
/box.json
4+
/box.phar
5+
/dist

.travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ before_script:
1212
git:
1313
depth: 99999
1414

15+
deploy:
16+
provider: releases
17+
api_key:
18+
secure: $DEPLOY_TOKEN_SECURE
19+
file: dist/roave-backward-compatibility-check.phar
20+
skip_cleanup: true
21+
on:
22+
tags: true
23+
1524
jobs:
1625
include:
1726

@@ -48,6 +57,10 @@ jobs:
4857
php: 7.2
4958
script: bin/roave-backward-compatibility-check --from=master --to=HEAD
5059

60+
- stage: Build release PHAR
61+
php: 7.2
62+
script: ./build-phar.sh
63+
5164
cache:
5265
directories:
5366
- $HOME/.composer/cache

box.json.dist

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compactors": [
3+
"Herrera\\Box\\Compactor\\Php",
4+
"Herrera\\Box\\Compactor\\Json"
5+
],
6+
"compression": "GZ",
7+
"main": "bin/roave-backward-compatibility-check.php",
8+
"output": "dist/roave-backward-compatibility-check.phar",
9+
"files-bin": [
10+
"LICENSE",
11+
"vendor/composer/composer/LICENSE"
12+
],
13+
"chmod": "0755",
14+
"git-version": "git-version"
15+
}

build-phar.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
if [ ! -f box.phar ]; then
4+
wget https://github.com/humbug/box/releases/download/3.0.0-beta.4/box.phar -O box.phar
5+
fi
6+
7+
# lock PHP to minimum allowed version
8+
composer config platform.php 7.2.0
9+
composer update --no-dev
10+
11+
php box.phar compile
12+
13+
git checkout composer.*
14+
composer install

0 commit comments

Comments
 (0)