forked from aws-observability/aws-otel-java-instrumentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ADOT Patch workflow
committed
Jan 10, 2024
1 parent
183e028
commit 04f7cad
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ nexusPublishing { | |
sonatype { | ||
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/")) | ||
username.set(System.getenv("PUBLISH_USERNAME")) | ||
password.set(System.getenv("PUBLISH_PASSWORD")) | ||
} | ||
} | ||
} | ||
|
@@ -187,6 +189,83 @@ allprojects { | |
} | ||
} | ||
} | ||
|
||
plugins.withId("maven-publish") { | ||
plugins.apply("signing") | ||
|
||
afterEvaluate { | ||
val publishTask = tasks.named("publishToSonatype") | ||
|
||
postReleaseTask.configure { | ||
dependsOn(publishTask) | ||
} | ||
} | ||
|
||
configure<PublishingExtension> { | ||
publications { | ||
register<MavenPublication>("maven") { | ||
afterEvaluate { | ||
artifactId = project.findProperty("archivesBaseName") as String | ||
} | ||
|
||
plugins.withId("java-platform") { | ||
from(components["javaPlatform"]) | ||
} | ||
plugins.withId("java") { | ||
from(components["java"]) | ||
} | ||
|
||
versionMapping { | ||
allVariants { | ||
fromResolutionResult() | ||
} | ||
} | ||
|
||
pom { | ||
name.set("AWS Distro for OpenTelemetry Java Agent") | ||
description.set( | ||
"The Amazon Web Services distribution of the OpenTelemetry Java Instrumentation.", | ||
) | ||
url.set("https:/github.com/aws-observability/aws-otel-java-instrumentation") | ||
|
||
licenses { | ||
license { | ||
name.set("Apache License, Version 2.0") | ||
url.set("https://aws.amazon.com/apache2.0") | ||
distribution.set("repo") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("amazonwebservices") | ||
organization.set("Amazon Web Services") | ||
organizationUrl.set("https://aws.amazon.com") | ||
roles.add("developer") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:[email protected]:aws-observability/aws-otel-java-instrumentation.git") | ||
developerConnection.set("scm:git:[email protected]:aws-observability/aws-otel-java-instrumentation.git") | ||
url.set("https://github.com/aws-observability/aws-otel-java-instrumentation.git") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<Sign>().configureEach { | ||
onlyIf { System.getenv("CI") == "true" } | ||
} | ||
|
||
configure<SigningExtension> { | ||
val signingKey = System.getenv("GPG_PRIVATE_KEY") | ||
val signingPassword = System.getenv("GPG_PASSPHRASE") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign(the<PublishingExtension>().publications["maven"]) | ||
} | ||
} | ||
} | ||
|
||
tasks { | ||
|