-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
31 lines (26 loc) · 1.01 KB
/
build.gradle.kts
File metadata and controls
31 lines (26 loc) · 1.01 KB
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.7.1-SNAPSHOT"
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-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")
}
}