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 - 'STAGING_REPOSITORY_URL="https://[email protected]/$STAGING_REPOSITORY.git"' 13 - 'PUBLIC_REPOSITORY_URL="https://[email protected]/aws/aws-sdk-java-v2.git"' 14 15 build: 16 commands: 17 - mkdir release 18 - cd release 19 - 20 - git clone -o staging -b release $STAGING_REPOSITORY_URL . 21 - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec` 22 - 23 - git remote add --fetch public $PUBLIC_REPOSITORY_URL 24 - | 25 if [ `git ls-remote --tags public | grep refs/tags/$RELEASE_VERSION | wc -l` -ge "1" ]; then 26 git push public :refs/tags/$RELEASE_VERSION 27 fi 28 - git tag -a $RELEASE_VERSION -m "AWS SDK for Java v2 ($RELEASE_VERSION)" 29 - 30 - git push public HEAD:release 31 - git push public $RELEASE_VERSION