aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-01-16 00:58:02 -0300
committerEuAndreh <eu@euandre.org>2022-01-16 01:11:11 -0300
commitb1dfe9219fa4e827697c2390495ac912e3a96ac6 (patch)
tree238bbb62640f567e56596f528f50892e38de8a8b /aux/workflow
parentReplace left-over usage of git.euandreh.xyz (diff)
downloadgit-permalink-b1dfe9219fa4e827697c2390495ac912e3a96ac6.tar.gz
git-permalink-b1dfe9219fa4e827697c2390495ac912e3a96ac6.tar.xz
aux/workflow/dist.sh: Enforce $VERSION and $DATE from Makefil stay in sync
Diffstat (limited to 'aux/workflow')
-rwxr-xr-xaux/workflow/dist.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh
index f950e7c..48a9d57 100755
--- a/aux/workflow/dist.sh
+++ b/aux/workflow/dist.sh
@@ -53,6 +53,12 @@ if git show "$VVERSION" 1>/dev/null 2>/dev/null; then
exit 1
fi
+if [ "v$(awk '/^VERSION *=/{print $3; exit}' Makefile)" != "$VVERSION" ]; then
+ echo "Version '$VVERSION' mismatch with \$(VERSION) in Makefile." >&2
+ echo 'Make sure to invoke this script with "make dist".' >&2
+ exit 1
+fi
+
if ! printf '%s\n%s\n' "$(git tag)" "$VVERSION" | sort -nct. -k1 -k2 -k3; then
echo 'New tag is not bigger than existing ones.' >&2
exit 1
@@ -63,6 +69,12 @@ if [ "$DATE" != "$(git log -1 --format=%cd --date=short HEAD)" ]; then
exit 1
fi
+if [ "$(awk '/^DATE *=/{print $3; exit}' Makefile)" != "$DATE" ]; then
+ echo "Date '$DATE' mismatch with \$(DATE) in Makefile." >&2
+ echo 'Make sure to invoke this script with "make dist".' >&2
+ exit 1
+fi
+
if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then
echo "Commit message isn't 'Release $VVERSION'." >&2
exit 1