-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle.kts
31 lines (26 loc) · 1016 Bytes
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
plugins {
base
// Publishing.
id("io.github.gradle-nexus.publish-plugin") version "2.0.0" // Needs to be applied to the root project.
}
group = "io.github.typesafegithub"
version = "3.0.2-SNAPSHOT"
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
packageGroup.set("io.github.typesafegithub")
}
val setIsSnapshotFlagInGithubOutput by tasks.registering {
// This property of a project needs to be resolved before the 'doLast' block because otherwise, Gradle
// configuration cache cannot be used.
val version = version
doLast {
val filePath = System.getenv("GITHUB_OUTPUT") ?: error("Expected GITHUB_OUTPUT variable to be set!")
val isSnapshot = version.toString().endsWith("-SNAPSHOT")
File(filePath).appendText("is-snapshot=$isSnapshot\n")
}
}