forked from aws/aws-sdk-java-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-snapshot-version.yml
29 lines (26 loc) · 1.13 KB
/
update-snapshot-version.yml
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
version: 0.2
phases:
install:
runtime-versions:
java: "$JAVA_RUNTIME"
pre_build:
commands:
- git config --global user.name "AWS"
- git config --global user.email "<>"
build:
commands:
- git checkout master
- git merge origin/release --no-ff --no-edit
- CURRENT_VERSION=$(cat pom.xml | grep "<version>" | head -1 | cut -d\> -f 2 | cut -d\< -f 1)
- echo "Current version is $CURRENT_VERSION"
- RELEASE_VERSION=`echo "$CURRENT_VERSION" | cut -d "-" -f1`
- MAJOR=$(echo $RELEASE_VERSION | cut -d'.' -f1)
- MINOR=$(echo $RELEASE_VERSION | cut -d'.' -f2)
- POINT=$(echo $RELEASE_VERSION | cut -d'.' -f3)
- NEXT_VERSION_SNAPSHOT="$MAJOR.$MINOR.$((POINT + 1))-SNAPSHOT"
- echo Next snapshot version - $NEXT_VERSION_SNAPSHOT
- mvn versions:set -DnewVersion=$NEXT_VERSION_SNAPSHOT -DgenerateBackupPoms=false -DprocessAllModules=true
- sed -i -E "s/(<version>).+(<\/version>)/\1$RELEASE_VERSION\2/" README.md
- git commit -am "Update to next snapshot version $NEXT_VERSION_SNAPSHOT"
- git status
- git push https://[email protected]/aws/aws-sdk-java-v2.git master