public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [PATCH] Add do-release.sh
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190722074131.GA32307@delia> (raw)

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

             reply	other threads:[~2019-07-22  7:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 Tom de Vries [this message]
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     ` Michael Matz
2019-01-01  0:00     ` Jakub Jelinek
2019-01-01  0:00       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190722074131.GA32307@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).