Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reproducable composer.lock available in main repo instead of here #27

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }}
steps:
Expand Down
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ help:

compile:
$(if $(TAG),,$(error TAG is not defined. Pass via "make compile TAG=4.2.1"))
$(if $(PHP),,$(error PHP is not defined. Pass via "make compile PHP=7.4.19"))
@echo Compiling $(TAG)
$(eval BUILD_DIR := $(shell mktemp -d -t grumphp-shim-build))
@echo Cloning GrumPHP $(TAG) in directory $(BUILD_DIR)
git clone git@github.com:phpro/grumphp.git $(BUILD_DIR)
git --work-tree=$(BUILD_DIR) --git-dir='$(BUILD_DIR)/.git' checkout 'tags/v$(TAG)'
make prepare BUILD_DIR=$(BUILD_DIR) PHP=$(PHP)
make prepare BUILD_DIR=$(BUILD_DIR)
make sanity BUILD_DIR=$(BUILD_DIR)
make cleanup BUILD_DIR=$(BUILD_DIR)
# Release tag
Expand All @@ -27,29 +26,21 @@ release:

testlocal:
$(if $(GRUMPHP_DIR),,$(error GRUMPHP_DIR is not defined. Pass via "make testlocal GRUMPHP_DIR=/path/to/grumphp"))
$(if $(PHP),,$(error PHP is not defined. Pass via "make testlocal PHP=7.4"))
$(eval BUILD_DIR := $(shell mktemp -d -t grumphp-shim-build))
@echo Copying GrumPHP to directory $(BUILD_DIR)
cp -r $(GRUMPHP_DIR)/. $(BUILD_DIR)
make prepare BUILD_DIR=$(BUILD_DIR) PHP=$(PHP)
make prepare BUILD_DIR=$(BUILD_DIR)
make cleanup BUILD_DIR=$(BUILD_DIR)

systemupdate:
composer self-update

prepare:
$(if $(PHP),,$(error PHP is not defined. Pass via "make prepare PHP=7.4.19"))
$(if $(BUILD_DIR),,$(error BUILD_DIR is not defined. Pass via "make prepare BUILD_DIR=/tmp/prepared-grumphp-src"))
make systemupdate
cp build/* '$(BUILD_DIR)'
cp src/Composer/FixBrokenStaticAutoloader.php '$(BUILD_DIR)/src/Composer'
php $(BUILD_DIR)/fix-some-stuff-in-composer.php
composer --working-dir='$(BUILD_DIR)' config platform.php '$(PHP)'
composer install --working-dir='$(BUILD_DIR)' --no-scripts --no-plugins --no-dev --no-interaction --optimize-autoloader
php -d error_reporting='(E_ALL & ~E_DEPRECATED)' ./vendor/bin/box compile --working-dir='$(BUILD_DIR)' -vvv
# Copy composer plugin
cp '$(BUILD_DIR)/src/Composer/GrumPHPPlugin.php' '$(ROOT_DIR)/src/Composer/GrumPHPPlugin.php'
cp '$(BUILD_DIR)/composer.lock' '$(ROOT_DIR)/phar.composer.lock'
# All good : lets finish up
cp '$(BUILD_DIR)/grumphp.phar' '$(ROOT_DIR)'
gpg --local-user toonverwerft@gmail.com --armor --detach-sign grumphp.phar
Expand All @@ -59,7 +50,7 @@ sanity:
$(if $(BUILD_DIR),,$(error BUILD_DIR is not defined. Pass via "make sanity BUILD_DIR=/tmp/prepared-grumphp-src"))
mv '$(BUILD_DIR)/composer.json.backup' '$(BUILD_DIR)/composer.json'
rm -rf '$(BUILD_DIR)/vendor'
composer update --dev --working-dir='$(BUILD_DIR)' --no-interaction
composer install --working-dir='$(BUILD_DIR)' --no-interaction
cd $(BUILD_DIR) && ./grumphp.phar run --testsuite=git_pre_commit && cd $(ROOT_DIR)

cleanup:
Expand Down
3 changes: 0 additions & 3 deletions build/fix-some-stuff-in-composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
$composerFile,
json_encode(
array_merge_recursive($composerData, [
'require' => [
'nikic/php-parser' => '~4.0',
],
'scripts' => [
'post-autoload-dump' => [
'GrumPHP\\Composer\\FixBrokenStaticAutoloader::fix'
Expand Down
Loading