forked from FraunhoferIOSB/FAAAST-Package-Explorer-Converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
45 lines (36 loc) · 1.1 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
#
VERSION=$1
NEXTVERSION=$2
if [[ -z "$3" ]]; then
NEXTBRANCH=`cat pom.xml | sed -n 's/^\s\+<tag>\([^<]\+\)<\/tag>/\1/p'`
else
NEXTBRANCH=$3
fi
echo "Releasing: ${VERSION},
tagged: v${VERSION},
next: ${NEXTVERSION}-SNAPSHOT
nextBranch: ${NEXTBRANCH}"
echo "Press enter to go"
read -s
echo "Replacing version numbers"
mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION}
sed -i 's/<tag>HEAD<\/tag>/<tag>v'${VERSION}'<\/tag>/g' pom.xml
sed -r -z 's/package-explorer-converter-\S+\.jar/package-explorer-converter-'${VERSION}'.jar/g' -i README.md
mvn -B spotless:apply
echo "Git add ."
git add .
echo "Next: git commit & Tag [enter]"
read -s
git commit -m "Release v${VERSION}"
git tag -m "Release v${VERSION}" -a v${VERSION}
echo "Next: replacing version nubmers [enter]"
read -s
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${NEXTVERSION}-SNAPSHOT
sed -i 's/<tag>v'${VERSION}'<\/tag>/<tag>'${NEXTBRANCH}'<\/tag>/g' pom.xml
echo "Git add ."
git add .
echo "Next: git commit [enter]"
read -s
git commit -m "Prepare for next development iteration"
echo "Done"