forked from phpmetrics/PhpMetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (26 loc) · 1.13 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
include artifacts/Makefile
# 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`"
@echo Releasing sources
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" bin/phpmetrics
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" src/functions.php
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" artifacts/debian/control
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" artifacts/bintray.json
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" doc/installation.md
@sed -i -r "s/(v[0-9]+\.[0-9]+\.[0-9]+)/`semver tag`/g" doc/README.md
@sed -i -r "s/([0-9]{4}\-[0-9]{2}\-[0-9]{2})/`date +%Y-%m-%d`/g" artifacts/bintray.json
@make changelog-deb
# Tag git with last release
release:
git add .semver releases/* bin/phpmetrics src/functions.php artifacts/bintray.json .github/ISSUE_TEMPLATE.md
git commit -m "releasing `semver tag`"
git tag `semver tag`
git push -u origin master
git push origin `semver tag`