From 1d64f1f1a416754bc23ebc4977587355b736f3e8 Mon Sep 17 00:00:00 2001 From: Telan <13066272+TheElan@users.noreply.github.com> Date: Mon, 13 Dec 2021 16:54:06 +0200 Subject: [PATCH] buildscript: fix publishing section --- build.gradle | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index b6d682e..4ec3084 100644 --- a/build.gradle +++ b/build.gradle @@ -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") } } }