forked from aws/aws-sdk-java-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-master-from-release.yml
50 lines (45 loc) · 2.08 KB
/
update-master-from-release.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: 0.2
phases:
install:
runtime-versions:
java: "$JAVA_RUNTIME"
pre_build:
commands:
- git config --global user.name "AWS"
- git config --global user.email "<>"
- 'PUBLIC_REPOSITORY_URL="https://[email protected]/aws/aws-sdk-java-v2.git"'
build:
commands:
- mkdir release
- cd release
-
- git clone -o public -b release $PUBLIC_REPOSITORY_URL .
- echo 'For debugging, running version command without -q'
- mvn -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec
- RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
- echo "Release version - $RELEASE_VERSION"
-
- MAJOR=$(echo $RELEASE_VERSION | cut -d'.' -f1)
- MINOR=$(echo $RELEASE_VERSION | cut -d'.' -f2)
- POINT=$(echo $RELEASE_VERSION | cut -d'.' -f3)
- NEW_VERSION_SNAPSHOT="$MAJOR.$MINOR.$((POINT + 1))-SNAPSHOT"
- echo "New snapshot version - $NEW_VERSION_SNAPSHOT"
-
- git checkout master
- git merge public/release --no-edit
-
- MASTER_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
- echo "Master version - $MASTER_VERSION"
-
- |
if [ "$MASTER_VERSION" != "$NEW_VERSION_SNAPSHOT" ]; then
mvn versions:set -DnewVersion=$NEW_VERSION_SNAPSHOT -DgenerateBackupPoms=false -DprocessAllModules=true || { echo "Failed to update POMs to next snapshot version"; exit 1; }
sed -i -E "s/(<version>).+(<\/version>)/\1$RELEASE_VERSION\2/" README.md
sed -i -E "s/(<awsjavasdk.previous.version>).+(<\/awsjavasdk.previous.version>)/\1$RELEASE_VERSION\2/" pom.xml
sed -i -E "s/(newVersion: ).+/\1$RELEASE_VERSION/" v2-migration/src/main/resources/META-INF/rewrite/upgrade-sdk-dependencies.yml
sed -i -E "s/(version: ).+/\1$RELEASE_VERSION/" v2-migration/src/main/resources/META-INF/rewrite/upgrade-sdk-dependencies.yml
git commit -am "Update to next snapshot version: $NEW_VERSION_SNAPSHOT"
fi
-
- git status
- git push