summaryrefslogtreecommitdiffstats
path: root/contrib/release/do-release.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:55:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:55:52 +0000
commitf7a951d79bc895eb2171c2570add9f4899794a10 (patch)
treecc0c7147f472fecbc93add134f5c0e5c1bb72529 /contrib/release/do-release.sh
parentInitial commit. (diff)
downloaddwz-f7a951d79bc895eb2171c2570add9f4899794a10.tar.xz
dwz-f7a951d79bc895eb2171c2570add9f4899794a10.zip
Adding upstream version 0.15.upstream/0.15upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/release/do-release.sh')
-rwxr-xr-xcontrib/release/do-release.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/contrib/release/do-release.sh b/contrib/release/do-release.sh
new file mode 100755
index 0000000..1127293
--- /dev/null
+++ b/contrib/release/do-release.sh
@@ -0,0 +1,67 @@
+#!/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
+
+set +x
+
+echo $version > VERSION
+
+git add VERSION
+
+git commit -m "Bump version to $version"
+
+git push origin master:master
+
+git tag -s -m "dwz $version release" dwz-$version
+
+git push origin dwz-$version