-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle.kts
54 lines (46 loc) · 1.78 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
alias(libs.plugins.idea.ext)
alias(libs.plugins.github.release)
}
allprojects {
// Required here, as setting buildscript from plugin doesn't work
buildscript {
configurations.all {
resolutionStrategy.force("commons-io:commons-io:2.18.0")
}
}
}
buildscript {
configurations.all {
resolutionStrategy.force("commons-io:commons-io:2.18.0")
}
}
val changelog: Provider<String> = provider {
val time = ZonedDateTime.now(ZoneId.of("Asia/Tokyo")).withNano(0).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
val fromFile = project.file(project.property("changelog_file")!!).readText()
val shortFormat = fromFile.split(Regex("^# ", RegexOption.MULTILINE), limit = 3)[1]
"""
QuarryPlus for Minecraft ${libs.versions.minecraft.get()}
Released at $time
| Name | Version |
| -- | -- |
| Minecraft | ${libs.versions.minecraft.get()} |
| Forge | ${libs.versions.forge.get()} |
| Fabric | ${libs.versions.fabric.api.get()} |
| NeoForge | ${libs.versions.neoforge.get()} |
""".trimIndent() + System.lineSeparator() + shortFormat
}
githubRelease {
owner = "Kotori316"
repo = "QuarryPlus"
token(project.findProperty("githubToken") as? String ?: System.getenv("REPO_TOKEN") ?: "")
targetCommitish = project.property("mod.branch") as String
tagName = provider { "v${project.project(":common").version}" }
releaseName = provider { "v${project.project(":common").version} for Minecraft ${libs.versions.minecraft.get()}" }
prerelease = false
body = changelog
dryRun = (System.getenv("RELEASE_DEBUG") ?: "true").toBoolean()
}