Skip to content

Commit

Permalink
hide credentials on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimaeon committed Jul 20, 2024
1 parent d8057ed commit a688e62
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,30 +137,26 @@ publishing {
nexusPublishing {
repositories {
sonatype {
val credentials =
Properties().apply {
val credFile = projectDir.resolve("credentials.properties")
if (credFile.exists()) {
credFile.inputStream().use {
load(it)
if (System.getenv("CI") == null) {
val credentials =
Properties().apply {
val credFile = projectDir.resolve("credentials.properties")
if (credFile.exists()) {
credFile.inputStream().use {
load(it)
}
}
}
}
val username: String by credentials
val password: String by credentials
val username: String by credentials
val password: String by credentials

this.username = username
this.password = password
this.username = username
this.password = password
}
}
}
}

nexusPublishing {
repositories {
sonatype()
}
}

signing {
sign(publishing.publications["pluginMaven"])
}
Expand Down

0 comments on commit a688e62

Please sign in to comment.