Skip to content

Commit

Permalink
fix: add repositories inside publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Ribó <elribonazo@gmail.com>
  • Loading branch information
elribonazo committed Jul 16, 2024
1 parent 2ee28eb commit 39a3d0b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ buildscript {
gradlePluginPortal()
google()
mavenCentral()
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN")
}
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
Expand All @@ -47,6 +39,16 @@ allprojects {
val allowedProjectsToPublish = listOf("apollo")
if (allowedProjectsToPublish.contains(project.name) && project.name.contains("androidDebug")) {
publishing {
repositories {
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN")
}
}
}
publications {
withType<MavenPublication> {
groupId = publishedMavenId
Expand Down

0 comments on commit 39a3d0b

Please sign in to comment.