Skip to content

Commit

Permalink
Drop composer.lock and instead lock PHP version when building phar
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 28, 2021
1 parent 6907aa2 commit abe3224
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1,441 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
php-version: ${{ matrix.php }}
- run: composer install
- run: vendor/bin/phpunit --coverage-text
- run: composer build

PHPUnit-hhvm:
name: PHPUnit (HHVM)
Expand All @@ -48,14 +49,3 @@ jobs:
with:
php-version: 7.3
- run: composer install --dry-run --working-dir=tests/install-as-dep

Build-phar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
- run: composer install
- run: composer build
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor
/build
/build/
/composer.lock
/phar-composer-*.phar
/vendor/
5 changes: 3 additions & 2 deletions bin/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@

passthru('
rm -rf build && mkdir build &&
cp -r bin/ src/ composer.json composer.lock LICENSE build/ && rm build/bin/build.php build/src/Clue/PharComposer/Box/Extract.php &&
cp -r bin/ src/ composer.json LICENSE build/ && rm build/bin/build.php build/src/Clue/PharComposer/Box/Extract.php &&
sed -i \'s/@dev/' . $version .'/g\' build/src/Clue/PharComposer/App.php &&
composer config -d build/ platform.php 5.3.6 &&
composer install -d build/ --no-dev &&
cd build/vendor && rm -rf */*/tests/ */*/src/tests/ */*/docs/ */*/*.md */*/composer.* */*/phpunit.* */*/.gitignore */*/.*.yml */*/*.xml && cd - >/dev/null &&
cd build/vendor/symfony/ && rm -rf */Symfony/Component/*/Tests/ */Symfony/Component/*/*.md */Symfony/Component/*/composer.* */Symfony/Component/*/phpunit.* */Symfony/Component/*/.gitignore && cd ->/dev/null &&
cd build/vendor/guzzle/guzzle && rm -r phar-stub.php phing/ && cd ->/dev/null &&
bin/phar-composer build build/ ' . escapeshellarg($out) . ' &&
build/bin/phar-composer build build/ ' . escapeshellarg($out) . ' &&
echo -n "Reported version is: " && php ' . escapeshellarg($out) . ' --version', $code);
exit($code);
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
],
"require": {
"php": ">=5.3.6",
"knplabs/packagist-api": "^1.0",
"symfony/console": "^5.0 || ^4.0 || ^3.0 || ^2.5",
"symfony/finder": "^5.0 || ^4.0 || ^3.0 || ^2.5",
Expand All @@ -23,11 +24,6 @@
"psr-0": {"Clue": "src/"}
},
"bin": ["bin/phar-composer"],
"config": {
"platform": {
"php": "5.3.6"
}
},
"scripts": {
"build": "@php bin/build.php"
}
Expand Down
Loading

0 comments on commit abe3224

Please sign in to comment.