-
Notifications
You must be signed in to change notification settings - Fork 936
Maven Central Migration #6375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Maven Central Migration #6375
Changes from all commits
e6984ce
3ae75dd
58a5c10
b5e8f40
05922a8
ef0f88d
0c5ee28
d7c2773
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- pip install awscli --upgrade --user | ||
|
||
pre_build: | ||
commands: | ||
- ROOT=`pwd` | ||
- SETTINGS_XML_TEMPLATE=buildspecs/resources/maven-central-release-settings.xml | ||
- SETTINGS_XML=release-settings-final.xml | ||
- SDK_SIGNING_GPG_SECRING=secring.gpg | ||
- SDK_SIGNING_GPG_SECRING_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-secret-ring-9d0YXc" | ||
- SDK_SIGNING_GPG_KEYNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-keyname-wFsOOg" | ||
- SDK_SIGNING_GPG_PASSPHRASE_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-passphrase-A0H1Kq" | ||
- SONATYPE_PASSWORD_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:maven-central-publishing-password-yktnUc" | ||
- SONATYPE_USERNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:maven-central-publishing-username-RDvOnW" | ||
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,http-client-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests" | ||
|
||
build: | ||
commands: | ||
- RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec` | ||
- ARTIFACT_URL="https://repo1.maven.org/maven2/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/" | ||
- | | ||
if ! curl -f --head $ARTIFACT_URL; then | ||
SONATYPE_USERNAME=`aws secretsmanager get-secret-value --secret-id $SONATYPE_USERNAME_ARN --query SecretString --output text` | ||
SONATYPE_PASSWORD=`aws secretsmanager get-secret-value --secret-id $SONATYPE_PASSWORD_ARN --query SecretString --output text` | ||
SDK_SIGNING_GPG_KEYNAME=`aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_KEYNAME_ARN --query SecretString --output text` | ||
SDK_SIGNING_GPG_PASSPHRASE=`aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_PASSPHRASE_ARN --query SecretString --output text` | ||
aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_SECRING_ARN --query SecretBinary --output text | base64 -d > $SDK_SIGNING_GPG_SECRING | ||
gpg --passphrase $SDK_SIGNING_GPG_PASSPHRASE --batch --import $SDK_SIGNING_GPG_SECRING | ||
cat $SETTINGS_XML_TEMPLATE | \ | ||
awk 'BEGIN { var=ENVIRON["SONATYPE_USERNAME"] } { gsub("\\$SONATYPE_USERNAME", var, $0); print }' | \ | ||
awk 'BEGIN { var=ENVIRON["SONATYPE_PASSWORD"] } { gsub("\\$SONATYPE_PASSWORD", var, $0); print }' | \ | ||
awk 'BEGIN { var=ENVIRON["SDK_SIGNING_GPG_PASSPHRASE"] } { gsub("\\$SDK_SIGNING_GPG_PASSPHRASE", var, $0); print }' | \ | ||
awk 'BEGIN { var=ENVIRON["SDK_SIGNING_GPG_KEYNAME"] } { gsub("\\$SDK_SIGNING_GPG_KEYNAME", var, $0); print }' > \ | ||
$SETTINGS_XML | ||
# Convert comma-separated list to space-separated list with !: prefix for each module | ||
MODULES_TO_SKIP_FORMATTED=$(echo $MODULES_TO_SKIP | sed 's/,/,!:/g' | sed 's/^/!:/') | ||
mvn clean deploy -B -s $SETTINGS_XML -Pcentral-portal-publishing -DperformRelease -DautoPublish=true -DdeploymentName="software.amazon.awssdk-$RELEASE_VERSION" -Dspotbugs.skip -DskipTests -Dcheckstyle.skip -Djapicmp.skip -Ddoclint=none -DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -pl $MODULES_TO_SKIP_FORMATTED | ||
# Report staging folder size to CloudWatch | ||
if [ -d "target/central-staging" ]; then | ||
STAGING_SIZE_MB=$(du -sm target/central-staging | cut -f1) | ||
aws cloudwatch put-metric-data \ | ||
--namespace "AwsJavaSdkRelease" \ | ||
RanVaknin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--metric-data "MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes,Dimensions=[{Name=ReleaseVersion,Value=$RELEASE_VERSION}]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it makes sense to use the SDK version as a dimension; In CloudWatch each combination of metric name and dimension value(s) is a separate metric. For the purposes tracking size over time and alarming on the size, we want the size of the SDK over time to be part of the same metric. |
||
else | ||
echo "Staging folder target/central-staging not found" | ||
fi | ||
else | ||
echo "This version was already released." | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<settings> | ||
<servers> | ||
<server> | ||
<id>central</id> | ||
<username>$SONATYPE_USERNAME</username> | ||
<password>$SONATYPE_PASSWORD</password> | ||
</server> | ||
</servers> | ||
<profiles> | ||
<profile> | ||
<id>central-portal-publishing</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<properties> | ||
<gpg.keyname>$SDK_SIGNING_GPG_KEYNAME</gpg.keyname> | ||
<gpg.passphrase>$SDK_SIGNING_GPG_PASSPHRASE</gpg.passphrase> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</settings> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,7 @@ | |
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version> | ||
<checkstyle.version>8.42</checkstyle.version> | ||
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version> | ||
<central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version> | ||
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version> | ||
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> | ||
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version> | ||
|
@@ -746,7 +747,43 @@ | |
<javadoc.skip>true</javadoc.skip> | ||
</properties> | ||
</profile> | ||
|
||
<profile> | ||
<id>central-portal-publishing</id> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a comment here explaining why we have both a normal It just might create confusion about which one we're supposed to be using. |
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<version>${maven-gpg-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<id>sign-artifacts</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<gpgArguments> | ||
<arg>--batch</arg> | ||
<arg>--pinentry-mode</arg> | ||
<arg>loopback</arg> | ||
</gpgArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.sonatype.central</groupId> | ||
<artifactId>central-publishing-maven-plugin</artifactId> | ||
<version>${central-publishing-maven-plugin.version}</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<publishingServerId>central</publishingServerId> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>publishing</id> | ||
<build> | ||
|
Uh oh!
There was an error while loading. Please reload this page.