Skip to content

Commit

Permalink
fix ci/cd x3
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypfau committed Oct 23, 2022
1 parent 6ecae4a commit 5a3cd01
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ if (localPropsFile.exists()) {
p.forEach { name, value -> ext.set(name.toString(), value) }
}

val isCI = System.getenv("CI") == "true"
val githubVersion = System.getenv("GITHUB_REF")?.substring(11)
if (isCI) {
checkNotNull(githubVersion) { "GITHUB_REF is not set" }
check(githubVersion.isNotEmpty()) { "GITHUB_REF is empty" }
check(githubVersion.matches(Regex("[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9]+)?"))) { "'$githubVersion' is not a valid version" }
}

allprojects {
group = "org.ton"
version = System.getenv("GITHUB_REF")
version = if (isCI && githubVersion != null) githubVersion else "1.0-SNAPSHOT"

apply(plugin = "kotlin-multiplatform")
apply(plugin = "kotlinx-serialization")
Expand Down

0 comments on commit 5a3cd01

Please sign in to comment.