1#!/bin/sh 2 3set -ex 4 5if [[ $DEPLOY_VERSION = *-SNAPSHOT ]]; then 6 # snapshot doesn't need to gpg sign the file to deploy 7 DEPLOY_FILE_GOAL=deploy:deploy-file 8 DEPLOY_REPOSITORY_URL=https://aws.oss.sonatype.org/content/repositories/snapshots 9 10else 11 # Need to sign the file to deploy to staging repo 12 DEPLOY_FILE_GOAL=gpg:sign-and-deploy-file 13 DEPLOY_REPOSITORY_URL=https://aws.oss.sonatype.org:443/service/local/staging/deployByRepositoryId/${STAGING_REPO_ID} 14fi 15 16CLASSIFIERS_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 18for str in ${CLASSIFIERS_ARRAY[@]}; do 19 FILES="${FILES}target/aws-crt-1.0.0-SNAPSHOT-$str.jar," 20 CLASSIFIERS="${CLASSIFIERS}${str}," 21 TYPES="${TYPES}jar," 22done 23 24# remove the last "," 25FILES=${FILES::-1} 26CLASSIFIERS=${CLASSIFIERS::-1} 27TYPES=${TYPES::-1} 28 29 30mvn -B -X $DEPLOY_FILE_GOAL \ 31 -Dgpg.passphrase=$GPG_PASSPHRASE \ 32 -DgroupId=software.amazon.awssdk.crt -DartifactId=aws-crt -Dpackaging=jar \ 33 -Dversion=$DEPLOY_VERSION \ 34 -Dfile=./target/aws-crt-$DEPLOY_VERSION.jar \ 35 -Dfiles=$FILES \ 36 -Dclassifiers=$CLASSIFIERS \ 37 -Dtypes=$TYPES \ 38 -DpomFile=pom.xml \ 39 -DrepositoryId=ossrh -Durl=$DEPLOY_REPOSITORY_URL 40