Skip to content

Commit a80a476

Browse files
committed
Build .phar with GitHub Actions
1 parent 2399a35 commit a80a476

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,37 @@ jobs:
4747
# run: |
4848
# wget http://psvcg.coreteks.org/php-semver-checker-git.phar
4949
# php php-semver-checker-git.phar suggest -vvv
50+
51+
phar:
52+
runs-on: ubuntu-latest
53+
name: Build PHAR
54+
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v3
58+
with:
59+
fetch-depth: 0
60+
61+
- name: Setup PHP
62+
uses: shivammathur/setup-php@v2
63+
with:
64+
php-version: 8.4
65+
tools: composer:v2
66+
67+
- name: Install dependencies
68+
run: composer install --prefer-dist --no-interaction --no-progress
69+
70+
- name: Install Box
71+
run: |
72+
wget https://github.com/box-project/box/releases/latest/download/box.phar
73+
chmod +x box.phar
74+
sudo mv box.phar /usr/local/bin/box
75+
76+
- name: Build PHAR
77+
run: box compile
78+
79+
- name: Upload PHAR artifact
80+
uses: actions/upload-artifact@v5
81+
with:
82+
name: php-semver-checker-phar
83+
path: php-semver-checker.phar

box.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"alias": "php-semver-checker.phar",
3-
"compactors": ["Herrera\\Box\\Compactor\\Php"],
4-
"compression": "GZ",
3+
"compactors": ["KevinGH\\Box\\Compactor\\Php"],
4+
"compression": "BZ2",
55
"directories": ["src"],
66
"files": ["LICENSE"],
77
"finder": [
@@ -11,7 +11,7 @@
1111
"in": "vendor"
1212
}
1313
],
14-
"git-version": "package_version",
14+
"git-tag": "package_version",
1515
"main": "bin/php-semver-checker",
1616
"output": "php-semver-checker.phar",
1717
"stub": true

0 commit comments

Comments
 (0)