Skip to content

Commit af66380

Browse files
committed
feat: Add a make tag release
1 parent 0742256 commit af66380

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ rebuild-release:
1010
update-release:
1111
./scripts/update-release.sh
1212

13+
tag:
14+
./scripts/tag-release.sh
15+
1316
release: make-release update-release
1417
@echo "Done"

scripts/tag-release.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
##
3+
# @license http://unlicense.org/UNLICENSE The UNLICENSE
4+
# @author William Desportes <[email protected]>
5+
##
6+
7+
GPG_KEY=${GPG_KEY:-C4D91FDFCEF6B4A3C653FD7890A0EF1B8251A889}
8+
9+
function get_version {
10+
VERSION=$($1 --version | cut -d ' ' -f 2 | sed -e 's/^[[:space:]]*//')
11+
[[ ${VERSION} =~ ^[0-9]+\.[0-9]+ ]] && VERSION_RANGE="${BASH_REMATCH[0]}"
12+
[[ ${VERSION} =~ ^[0-9]+\.[0-9]+\.[0-9]+-dev$ ]] && VERSION_MATCH_DEV="${BASH_REMATCH[0]}"
13+
14+
if [ ! -z "${VERSION_MATCH_DEV}" ]; then
15+
echo "Releasing a development version is impossible.";
16+
exit 1
17+
else
18+
echo "Releasing a normal version.";
19+
fi
20+
}
21+
22+
get_version ./bin/doctum.php
23+
24+
echo "Version: ${VERSION}"
25+
26+
git tag --sign --annotate --local-user="${GPG_KEY}" --message="v${VERSION}" "v${VERSION}"

0 commit comments

Comments
 (0)