Skip to content

Commit

Permalink
chore: add a task to updateVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Dec 16, 2024
1 parent 6f9b3c8 commit dc4289b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ tasks.register("generateBuildRecord") {
}

tasks.named("processResources") {
dependsOn("copyFrontendBuildResults", "updateVersion", "generateBuildRecord")
dependsOn("copyFrontendBuildResults", "generateBuildRecord")
}

tasks.register<Delete>("cleanStaticResources") {
Expand Down
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ plugins {

group = "io.sakurasou"

tasks.register("updateVersion") {
dependsOn(":app:updateVersion", "updateComposeImageTag")
}

tasks.register("updateComposeImageTag") {
val composeFile = file("compose.yml")
val contents = composeFile.readText()
val regex = Regex("(shiinakin/hoshizora-pics:)(.*)")
val newContents = contents.replace(regex) { matchResult ->
"${matchResult.groupValues[1]}$version"
}
composeFile.writeText(newContents)
}

tasks.register("build") {
group = "build"
dependsOn(":app:build")
Expand Down

0 comments on commit dc4289b

Please sign in to comment.