forked from phpmetrics/PhpMetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (29 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
REPLACE=`semver tag`
# Build phar
build: test
@echo Copying sources
@mkdir -p /tmp/phpmetrics-build
@cp * -R /tmp/phpmetrics-build
@rm -Rf /tmp/phpmetrics-build/vendor /tmp/phpmetrics-build/composer.lock
@echo Releasing phar
@sed -i "s/<VERSION>/`semver tag`/g" /tmp/phpmetrics-build/build.php
@echo Installing dependencies
@cd /tmp/phpmetrics-build && composer.phar install --no-dev --optimize-autoloader --prefer-dist
@echo Building phar
@cd /tmp/phpmetrics-build && php build.php
@cp /tmp/phpmetrics-build/build/phpmetrics.phar build/phpmetrics.phar
@rm -Rf /tmp/phpmetrics-build
@echo Testing phar
./vendor/bin/phpunit -c phpunit.xml.dist --group=binary && echo "Done"
# Run unit tests
test:
./vendor/bin/phpunit -c phpunit.xml.dist
# Publish new release. Usage:
# make tag VERSION=(major|minor|patch)
# You need to install https://github.com/flazz/semver/ before
tag:
@semver inc $(VERSION)
@echo "New release: `semver tag`"
# Tag git with last release
git_tag:
git tag -a $(semver tag) -m "tagging $(semver tag)"