buildscript: fix publishing section

This commit is contained in:
Telan committed 2021-12-13 16:54:06 +02:00
1 parent fae84dcbe0
commit 1d64f1f1a4
1 file changed
+9 -16
+9 -16
View File
@@ -464,23 +464,16 @@ artifacts {
// publishing
publishing {
repositories {
String owner = System.getenv("REPOSITORY_OWNER")
String repositoryName = System.getenv("REPOSITORY_NAME")
String githubUser = System.getenv("GITHUB_ACTOR")
String githubToken = System.getenv("GITHUB_TOKEN")
boolean isInGithubCIEnvironment = owner != null && repositoryName != null && githubUser != null && githubToken != null
if (isInGithubCIEnvironment) {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/$owner/$repositoryName"
credentials {
username = githubUser
password = githubToken
}
maven {
String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown"
String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown"
String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName"
name = "GitHubPackages"
url = githubRepositoryUrl
credentials {
username = System.getenv("GITHUB_ACTOR") ?: "NONE"
password = System.getenv("GITHUB_TOKEN") ?: "NONE"
}
} else {
print("Assuming not being in CI environment: skipping github publishing configuration")
}
}
}