xref: /aosp_15_r20/external/aws-sdk-java-v2/buildspecs/update-snapshot-version.yml (revision 8a52c7834d808308836a99fc2a6e0ed8db339086)
1version: 0.2
2
3phases:
4  install:
5    runtime-versions:
6      java: "$JAVA_RUNTIME"
7
8  pre_build:
9    commands:
10    - git config --global user.name "AWS"
11    - git config --global user.email "<>"
12
13  build:
14    commands:
15    - git checkout master
16    - git merge origin/release --no-ff --no-edit
17    - CURRENT_VERSION=$(cat pom.xml | grep "<version>" | head -1 | cut -d\> -f 2 | cut -d\< -f 1)
18    - echo "Current version is $CURRENT_VERSION"
19    - RELEASE_VERSION=`echo "$CURRENT_VERSION" | cut -d "-" -f1`
20    - MAJOR=$(echo $RELEASE_VERSION | cut -d'.' -f1)
21    - MINOR=$(echo $RELEASE_VERSION | cut -d'.' -f2)
22    - POINT=$(echo $RELEASE_VERSION | cut -d'.' -f3)
23    - NEXT_VERSION_SNAPSHOT="$MAJOR.$MINOR.$((POINT + 1))-SNAPSHOT"
24    - echo Next snapshot version - $NEXT_VERSION_SNAPSHOT
25    - mvn versions:set -DnewVersion=$NEXT_VERSION_SNAPSHOT -DgenerateBackupPoms=false -DprocessAllModules=true
26    - sed -i -E "s/(<version>).+(<\/version>)/\1$RELEASE_VERSION\2/" README.md
27    - git commit -am "Update to next snapshot version $NEXT_VERSION_SNAPSHOT"
28    - git status
29    - git push https://[email protected]/aws/aws-sdk-java-v2.git master
30