Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • 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.
79 changes: 79 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 04f7cad

Please sign in to comment.