fix(build): restore snapshot publishing

This commit is contained in:
Harsh Shandilya 2023-08-31 21:18:08 +05:30
parent 5d88430a78
commit c8a7fe89f1
No known key found for this signature in database
1 changed files with 8 additions and 4 deletions

View File

@ -31,10 +31,14 @@ class TraceLogBuildExtensionImpl(
maven {
name = "Sonatype"
setUrl {
val repositoryId =
System.getenv("SONATYPE_REPOSITORY_ID")
?: error("Missing env variable: SONATYPE_REPOSITORY_ID")
"https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/"
if (project.findProperty("VERSION_NAME").toString().endsWith("-SNAPSHOT")) {
"https://oss.sonatype.org/content/repositories/snapshots/"
} else {
val repositoryId =
System.getenv("SONATYPE_REPOSITORY_ID")
?: error("Missing env variable: SONATYPE_REPOSITORY_ID")
"https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}/"
}
}
credentials {
username = System.getenv("SONATYPE_USERNAME")