From c0883d018099240597f635254b49d23ba3cec13e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 16 May 2025 12:41:45 +0600 Subject: [PATCH] update github publishing part --- build.gradle | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index c110388a86..e9b1c841af 100644 --- a/build.gradle +++ b/build.gradle @@ -48,12 +48,20 @@ private String getCurrentVersionChangelog() { return changelogDataOS.toString().trim() } -if (new File(projectDir, "secret.gradle").exists()) { - apply from: './secret.gradle' + +def githubTokenVariableName = "GITHUB_RELEASE_TOKEN" +def githubTokenVariableFromEnv = System.getenv(githubTokenVariableName) + +def secretFile = new File(projectDir, "secret.gradle") +if (secretFile.exists() || project.hasProperty(githubTokenVariableName) || (githubTokenVariableFromEnv != "" && githubTokenVariableFromEnv != null)) { + if (secretFile.exists()) { + apply from: './secret.gradle' + } apply plugin: "com.github.breadmoirai.github-release" + def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv githubRelease { - token "${project.property('GITHUB_RELEASE_TOKEN')}" + token githubReleaseToken owner = "InsanusMokrassar" repo = "TelegramBotAPI"