diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9f99af0..e4f232b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -169,7 +169,7 @@ tasks.register("generateBuildRecord") { } tasks.named("processResources") { - dependsOn("copyFrontendBuildResults", "updateVersion", "generateBuildRecord") + dependsOn("copyFrontendBuildResults", "generateBuildRecord") } tasks.register("cleanStaticResources") { diff --git a/build.gradle.kts b/build.gradle.kts index 880e674..a7cd5bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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")