xref: /JGit/tools/release.sh (revision e3b45f79b68252bf574c29aca4e21c39c53e1e19)
1#!/bin/bash
2#
3# script to create a jgit release
4
5# uncomment to switch on trace
6#set -x
7
8# abort if a command hits an error
9set -e
10
11export basePath=$(cd "$(dirname "$0")"; pwd)
12echo basePath $basePath
13
14if [ -z $1 ]; then
15    echo "
16    Usage:
17    $ release.sh <release version tag>
18
19    e.g. release.sh v3.4.0.201405051725-m7
20"
21    exit
22fi
23
24# trimmed git status
25export status=$(git status --porcelain)
26
27if [ ! -z "$status" ];
28then
29    echo "
30    working tree is dirty -> can't create release
31"
32    exit
33fi
34
35MSG="JGit $1"
36
37# tag release
38git tag -s -m "$MSG" $1
39
40# update version numbers
41./tools/version.sh --release
42
43# commit changed version numbers
44git commit -a -s -m "$MSG"
45
46# move the tag to the version we release
47git tag -sf -m "$MSG" $1
48
49# run the build
50mvn clean install -T 1C
51mvn clean install -f org.eclipse.jgit.packaging/pom.xml
52