diff --git a/Makefile b/Makefile index ba46f2c..5b98606 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,6 @@ .PHONY: test test: composer-dump composer-validate phpstan psalm phpunit -.PHONY: monorepo -monorepo: validate merge - -.PHONY: merge -merge: - vendor/bin/monorepo-builder merge - -.PHONY: validate -validate: - vendor/bin/monorepo-builder validate - .PHONY: phpstan phpstan: vendor/bin/phpstan analyse @@ -45,3 +34,23 @@ tools/php-cs-fixer: rector: $(PHP) vendor/bin/rector process > rector.log make php-cs-fixer + +.PHONY: monorepo +monorepo: monorepo-validate monorepo-merge + +.PHONY: monorepo-validate +monorepo-validate: + vendor/bin/monorepo-builder validate + +.PHONY: monorepo-merge +monorepo-merge: + $(PHP) vendor/bin/monorepo-builder merge + +.PHONY: monorepo-release-% +monorepo-release-%: + git update-index --really-refresh > /dev/null; git diff-index --quiet HEAD || (echo "Working directory is not clean, aborting" && exit 1) + [ $$(git branch --show-current) == main ] || (echo "Not on main branch, aborting" && exit 1) + $(PHP) vendor/bin/monorepo-builder release $* + git switch -c release/$* + git add . + git commit -m "release: $*"