1*3c7ae9deSAndroid Build Coastguard Worker#!/bin/sh 2*3c7ae9deSAndroid Build Coastguard Worker 3*3c7ae9deSAndroid Build Coastguard Workerset -ex 4*3c7ae9deSAndroid Build Coastguard Worker 5*3c7ae9deSAndroid Build Coastguard Workerif [[ $DEPLOY_VERSION = *-SNAPSHOT ]]; then 6*3c7ae9deSAndroid Build Coastguard Worker # snapshot doesn't need to gpg sign the file to deploy 7*3c7ae9deSAndroid Build Coastguard Worker DEPLOY_FILE_GOAL=deploy:deploy-file 8*3c7ae9deSAndroid Build Coastguard Worker DEPLOY_REPOSITORY_URL=https://aws.oss.sonatype.org/content/repositories/snapshots 9*3c7ae9deSAndroid Build Coastguard Worker 10*3c7ae9deSAndroid Build Coastguard Workerelse 11*3c7ae9deSAndroid Build Coastguard Worker # Need to sign the file to deploy to staging repo 12*3c7ae9deSAndroid Build Coastguard Worker DEPLOY_FILE_GOAL=gpg:sign-and-deploy-file 13*3c7ae9deSAndroid Build Coastguard Worker DEPLOY_REPOSITORY_URL=https://aws.oss.sonatype.org:443/service/local/staging/deployByRepositoryId/${STAGING_REPO_ID} 14*3c7ae9deSAndroid Build Coastguard Workerfi 15*3c7ae9deSAndroid Build Coastguard Worker 16*3c7ae9deSAndroid Build Coastguard WorkerCLASSIFIERS_ARRAY=("linux-armv6" "linux-armv7" "linux-aarch_64" "linux-x86_32" "linux-x86_64" "osx-aarch_64" "osx-x86_64" "windows-x86_32" "windows-x86_64" "linux-x86_64-musl" "linux-armv7-musl" "linux-aarch_64-musl") 17*3c7ae9deSAndroid Build Coastguard Worker 18*3c7ae9deSAndroid Build Coastguard Workerfor str in ${CLASSIFIERS_ARRAY[@]}; do 19*3c7ae9deSAndroid Build Coastguard Worker FILES="${FILES}target/aws-crt-1.0.0-SNAPSHOT-$str.jar," 20*3c7ae9deSAndroid Build Coastguard Worker CLASSIFIERS="${CLASSIFIERS}${str}," 21*3c7ae9deSAndroid Build Coastguard Worker TYPES="${TYPES}jar," 22*3c7ae9deSAndroid Build Coastguard Workerdone 23*3c7ae9deSAndroid Build Coastguard Worker 24*3c7ae9deSAndroid Build Coastguard Worker# remove the last "," 25*3c7ae9deSAndroid Build Coastguard WorkerFILES=${FILES::-1} 26*3c7ae9deSAndroid Build Coastguard WorkerCLASSIFIERS=${CLASSIFIERS::-1} 27*3c7ae9deSAndroid Build Coastguard WorkerTYPES=${TYPES::-1} 28*3c7ae9deSAndroid Build Coastguard Worker 29*3c7ae9deSAndroid Build Coastguard Worker 30*3c7ae9deSAndroid Build Coastguard Workermvn -B -X $DEPLOY_FILE_GOAL \ 31*3c7ae9deSAndroid Build Coastguard Worker -Dgpg.passphrase=$GPG_PASSPHRASE \ 32*3c7ae9deSAndroid Build Coastguard Worker -DgroupId=software.amazon.awssdk.crt -DartifactId=aws-crt -Dpackaging=jar \ 33*3c7ae9deSAndroid Build Coastguard Worker -Dversion=$DEPLOY_VERSION \ 34*3c7ae9deSAndroid Build Coastguard Worker -Dfile=./target/aws-crt-$DEPLOY_VERSION.jar \ 35*3c7ae9deSAndroid Build Coastguard Worker -Dfiles=$FILES \ 36*3c7ae9deSAndroid Build Coastguard Worker -Dclassifiers=$CLASSIFIERS \ 37*3c7ae9deSAndroid Build Coastguard Worker -Dtypes=$TYPES \ 38*3c7ae9deSAndroid Build Coastguard Worker -DpomFile=pom.xml \ 39*3c7ae9deSAndroid Build Coastguard Worker -DrepositoryId=ossrh -Durl=$DEPLOY_REPOSITORY_URL 40