xref: /aosp_15_r20/external/aws-sdk-java-v2/buildspecs/release-to-github.yml (revision 8a52c7834d808308836a99fc2a6e0ed8db339086)
1*8a52c783SCole Faustversion: 0.2
2*8a52c783SCole Faust
3*8a52c783SCole Faustphases:
4*8a52c783SCole Faust  install:
5*8a52c783SCole Faust    runtime-versions:
6*8a52c783SCole Faust      java: "$JAVA_RUNTIME"
7*8a52c783SCole Faust
8*8a52c783SCole Faust  pre_build:
9*8a52c783SCole Faust    commands:
10*8a52c783SCole Faust    - git config --global user.name "AWS"
11*8a52c783SCole Faust    - git config --global user.email "<>"
12*8a52c783SCole Faust    - 'STAGING_REPOSITORY_URL="https://[email protected]/$STAGING_REPOSITORY.git"'
13*8a52c783SCole Faust    - 'PUBLIC_REPOSITORY_URL="https://[email protected]/aws/aws-sdk-java-v2.git"'
14*8a52c783SCole Faust
15*8a52c783SCole Faust  build:
16*8a52c783SCole Faust    commands:
17*8a52c783SCole Faust    - mkdir release
18*8a52c783SCole Faust    - cd release
19*8a52c783SCole Faust    -
20*8a52c783SCole Faust    - git clone -o staging -b release $STAGING_REPOSITORY_URL .
21*8a52c783SCole Faust    - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
22*8a52c783SCole Faust    -
23*8a52c783SCole Faust    - git remote add --fetch public $PUBLIC_REPOSITORY_URL
24*8a52c783SCole Faust    - |
25*8a52c783SCole Faust      if [ `git ls-remote --tags public  | grep refs/tags/$RELEASE_VERSION | wc -l` -ge "1" ]; then
26*8a52c783SCole Faust        git push public :refs/tags/$RELEASE_VERSION
27*8a52c783SCole Faust      fi
28*8a52c783SCole Faust    - git tag -a $RELEASE_VERSION -m "AWS SDK for Java v2 ($RELEASE_VERSION)"
29*8a52c783SCole Faust    -
30*8a52c783SCole Faust    - git push public HEAD:release
31*8a52c783SCole Faust    - git push public $RELEASE_VERSION