aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-01-04 16:16:12 -0500
committerB. Watson <urchlay@slackware.uk>2024-01-04 16:16:12 -0500
commit69341752a93edf39d9bedbe435d7543f4068ac65 (patch)
treec8cc7687299b20177717204f46faf242a56f96e5
parentc805a89e0944a8eb0f0db959db326be517221891 (diff)
downloadhcalc-69341752a93edf39d9bedbe435d7543f4068ac65.tar.gz
Makefile: Add release target.
-rw-r--r--Makefile5
-rw-r--r--makerelease.sh16
2 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index beb6221..a937a0d 100644
--- a/Makefile
+++ b/Makefile
@@ -95,4 +95,7 @@ install: all
done
$(GZIP) -9f $(DESTDIR)$(MAN1DIR)/$(MANPAGE)
-.PHONY: all clean realclean install
+release:
+ sh makerelease.sh $(VERSION)
+
+.PHONY: all clean realclean install release
diff --git a/makerelease.sh b/makerelease.sh
new file mode 100644
index 0000000..86b0d88
--- /dev/null
+++ b/makerelease.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+VERSION="$1"
+if [ "$VERSION" = "" -o "$2" != "" ]; then
+ echo "Usage: makerelese.sh VERSION"
+ exit 1
+fi
+
+git rev-parse || exit 1
+if [ "$( git tag -l "$VERSION" )" != "" ]; then
+ echo "There's already a $VERSION tag, did you forget to update VERSION in the Makefile?"
+ exit 1
+fi
+
+git tag -a -m"Version $VERSION release." "$VERSION"
+git push