public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add do-release.sh
@ 2019-01-01  0:00 Tom de Vries
  2019-01-01  0:00 ` Jakub Jelinek
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

this commit adds a script that:
- bumps either the minor or the major version, using options
  --major or --minor
- updates VERSION
- commits VERSION update
- tags VERSION update

OK for trunk?

Is there anything else involved in doing a release?

Thanks,
- Tom

Add do-release.sh

2019-07-22  Tom de Vries  <tdevries@suse.de>

	* do-release.sh: New file.

---
 do-release.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/do-release.sh b/do-release.sh
new file mode 100755
index 0000000..f1bb4d9
--- /dev/null
+++ b/do-release.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+set -e
+
+do_minor=false
+do_major=false
+
+while [ $# -gt 0 ]; do
+    case "$1" in
+	--minor)
+	    do_minor=true
+	    ;;
+	--major)
+	    do_major=true
+	    ;;
+	*)
+	    echo "Unknown option: $1"
+	    exit 1
+    esac
+    shift
+done
+
+if $do_minor && $do_major; then
+    echo "Can only bump minor or major, not both"
+    exit 1
+fi
+
+if ! $do_minor && ! $do_major; then
+    echo "Need to bump minor or major"
+    exit 1
+fi
+
+git checkout master
+
+version=$(cat VERSION)
+
+minor=$(echo $version \
+	    | sed 's/.*\.//')
+major=$(echo $version \
+	    | sed 's/\..*//')
+echo Current version: major: $major,  minor: $minor
+
+if $do_minor; then
+    echo "Bumping minor version"
+    minor=$(($minor + 1))
+elif $do_major; then
+    echo "Bumping major version"
+    major=$(($major + 1))
+    minor=0
+fi
+echo Bumped version: major: $major,  minor: $minor
+
+version=$major.$minor
+
+echo $version > VERSION
+
+git add VERSION
+
+git commit -m "Bump version to $version"
+
+git tag dwz-$version

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-08-16 11:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [PATCH] Add do-release.sh Tom de Vries
2019-01-01  0:00 ` Jakub Jelinek
2019-01-01  0:00   ` Tom de Vries
2019-01-01  0:00     ` [committed] Update --version copyright message Tom de Vries
2019-01-01  0:00       ` Branch creation: dwz-0.13-branch Tom de Vries
2019-01-01  0:00   ` [committed] Copy dwarf2.def, dwarf2.h and dwarfnames.c from gcc Tom de Vries
2019-01-01  0:00   ` [PATCH] Add do-release.sh Tom de Vries
2019-01-01  0:00     ` Jakub Jelinek
2019-01-01  0:00       ` Tom de Vries
2019-01-01  0:00     ` Michael Matz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).