-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
44 lines (38 loc) · 1.08 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
import org.apache.tools.ant.filters.ReplaceTokens
import pl.allegro.tech.build.axion.release.domain.hooks.HookContext
plugins {
alias(libs.plugins.nexus)
id("sbapsd.project-conventions")
id("pl.allegro.tech.build.axion-release")
}
scmVersion {
hooks {
pre { c: HookContext -> c.addCommitPattern("README.md") }
pre("commit")
}
}
nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("OSSRH_USER") ?: return@sonatype)
password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype)
}
}
}
val releaseUpdatableFiles = listOf(
Pair("src/README.md", ".")
)
val updateReleaseDependentFiles by tasks.registering(Copy::class) {
releaseUpdatableFiles.forEach {
from(it.first) {
filter(ReplaceTokens::class, Pair("tokens", mapOf(Pair("version", version))))
into(it.second)
}
}
into(projectDir)
doNotTrackState("workaround")
mustRunAfter("verifyRelease")
}
tasks.named("createRelease").configure {
dependsOn(updateReleaseDependentFiles)
}