File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ VERSION=$1
4
+ SNAPSHOT_VERSION=$2
5
+
6
+ # Exit if git tree is not clean
7
+ if [ -n " $( git status --porcelain) " ]; then
8
+ echo " Git tree is not clean, aborting release."
9
+ exit 1
10
+ fi
11
+
12
+ # Exit if version is not correct
13
+ if ! [[ $VERSION =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
14
+ echo " Version is not correct, aborting release."
15
+ exit 1
16
+ fi
17
+
18
+ # Exit if snapshot version is not correct
19
+ if ! [[ $SNAPSHOT_VERSION =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
20
+ echo " Snapshot Version is not correct, aborting release."
21
+ exit 1
22
+ fi
23
+
24
+ # Set version on pom
25
+
26
+ mvn versions:set -DnewVersion=$VERSION
27
+ git add -A
28
+ git commit -m " chore(release): v$VERSION "
29
+ git tag -a v$VERSION -m " Release v$VERSION "
30
+ conventional-changelog -p angular -i CHANGELOG.md -s -r 0
31
+ git add CHANGELOG.md
32
+ git commit -m " chore(release): add changelog for v$VERSION "
33
+ mvn -Possrh clean package
34
+ mvn -Possrh deploy
35
+
36
+ # Set next snapshot
37
+
38
+ mvn versions:set -DnewVersion=${SNAPSHOT_VERSION} -SNAPSHOT
39
+ git add -A
40
+ git commit -m " chore(release): set new snapshot version $SNAPSHOT_VERSION "
41
+
42
+ # git push origin v$VERSION
You can’t perform that action at this time.
0 commit comments