mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-07 17:19:32 +00:00
update github_release.gradle to allow it to publish with env instead of secret.gradle
This commit is contained in:
@@ -11,12 +11,20 @@ private String getCurrentVersionChangelog() {
|
|||||||
return changelogDataOS.toString().trim()
|
return changelogDataOS.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new File(projectDir, "secret.gradle").exists()) {
|
|
||||||
|
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 from: './secret.gradle'
|
||||||
|
}
|
||||||
apply plugin: "com.github.breadmoirai.github-release"
|
apply plugin: "com.github.breadmoirai.github-release"
|
||||||
|
def githubReleaseToken = project.hasProperty(githubTokenVariableName) ? project.property(githubTokenVariableName).toString() : githubTokenVariableFromEnv
|
||||||
|
|
||||||
githubRelease {
|
githubRelease {
|
||||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
token githubReleaseToken
|
||||||
|
|
||||||
owner = "InsanusMokrassar"
|
owner = "InsanusMokrassar"
|
||||||
repo = "MicroUtils"
|
repo = "MicroUtils"
|
||||||
|
Reference in New Issue
Block a user