forked from timurstrekalov/saga
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
executable file
·48 lines (36 loc) · 1.2 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
46
47
48
#!/bin/bash
CUR_VERSION=`mvn help:evaluate -Dexpression=project.version | grep -v '\['`
while getopts "d:r:" opt
do
case "$opt" in
d) DEV_VERSION=$OPTARG;;
r) REL_VERSION=$OPTARG;;
esac
done
if [[ -n "$DEV_VERSION" && -n "$REL_VERSION" ]]
then
echo "Development version: $DEV_VERSION"
echo "Release version: $REL_VERSION"
mvn release:clean && \
mvn release:prepare \
--batch-mode \
-Dtag=saga-root-$REL_VERSION \
-DreleaseVersion=$REL_VERSION \
-DdevelopmentVersion=$DEV_VERSION && \
mvn release:perform
else
echo "Usage: ./release.sh -d <development version> -r <release version>"
exit 1
fi
sed -Ei -e "s/(def projectVersion = )('$CUR_VERSION')/\1'$REL_VERSION'/" ./gradle-saga-plugin/build.gradle
cd gradle-saga-plugin
git add build.gradle
git commit -m "releasing Gradle plugin version $REL_VERSION"
git push
gradle -Prelease uploadArchives
sed -Ei -e "s/(def projectVersion = )('$REL_VERSION')/\1'$DEV_VERSION'/" build.gradle
rm build.gradle-e
git add build.gradle
git commit -m "preparing for next development iteration ($DEV_VERSION)"
git push
cd -