Skip to content

Commit 75f72f6

Browse files
committed
Fix own version
1 parent 7a94931 commit 75f72f6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ plugins {
88
id("org.jetbrains.dokka") version "1.9.20" // Do not update because of kotlin("jvm") version
99
}
1010

11+
// Get version
12+
version =
13+
System.getenv("GITHUB_REF_NAME")
14+
?.takeIf { System.getenv("GITHUB_REF_TYPE") == "tag" }
15+
?: System.getenv("GITHUB_SHA")
16+
?.takeIf { it.isNotBlank() }
17+
?.take(7)
18+
?: "dev"
19+
1120
group = "xyz.srnyx"
12-
version = providers.environmentVariable("VERSION").orNull?.takeIf(String::isNotBlank) ?: "3.1.0"
1321
description = "A Gradle plugin to simplify the process of creating projects"
1422
val projectId: String = "gradle-galaxy"
1523
val vcs: String = "github.com/srnyx/$projectId"

0 commit comments

Comments
 (0)