Skip to content

Commit

Permalink
fix: release tag manage
Browse files Browse the repository at this point in the history
  • Loading branch information
sgpublic committed Jul 29, 2024
1 parent f3442b3 commit 424a117
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ tasks {
dependsOn(dockerCreateDockerfile)
inputDir = layout.buildDirectory.dir("docker-linuxqq")
dockerFile = dockerCreateDockerfile.destFile
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}-$version" })
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}-${qqntInfo["dockerimage.version"]}" })
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}" })
images.add("$tag:latest")
noCache = true
Expand All @@ -129,7 +129,7 @@ tasks {
val dockerPushBuildBookImageOfficial by creating(DockerPushImage::class) {
group = "docker"
dependsOn(dockerBuildImage)
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}-$version" })
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}-${qqntInfo["dockerimage.version"]}" })
images.add(provider { "$tag:v${qqntInfo["linuxqq.version"]}" })
images.add("$tag:latest")
}
Expand All @@ -140,8 +140,8 @@ tasks {
}
owner = "sgpublic"
repo = "docker-linuxqq"
tagName = provider { "v${qqntInfo["linuxqq.version"]}-$version" }
releaseName = provider { "v${qqntInfo["linuxqq.version"]}-$version" }
tagName = provider { "v${qqntInfo["linuxqq.version"]}-${qqntInfo["dockerimage.version"]}" }
releaseName = provider { "v${qqntInfo["linuxqq.version"]}-${qqntInfo["dockerimage.version"]}" }
overwrite = true
}
}
Expand Down
7 changes: 5 additions & 2 deletions buildSrc/src/main/kotlin/io/github/sgpublic/QQNTInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ abstract class QQNTInfo: DefaultTask() {
val qqntFile = "linuxqq-$qqntVersion.deb"
content.add("linuxqq.file", JsonPrimitive(qqntFile))

content.add("dockerimage.verison", JsonPrimitive(project.version.toString()))
var dockerImageVersion = project.version.toString().toLong()
content.add("dockerimage.version", JsonPrimitive(dockerImageVersion))

if (content != readCache()) {
dockerImageVersion += 1
content.add("dockerimage.version", JsonPrimitive(dockerImageVersion))
cacheFile.writeText(GsonBuilder()
.setPrettyPrinting()
.create()
Expand All @@ -74,7 +77,7 @@ abstract class QQNTInfo: DefaultTask() {
.setAuthor("updater", "[email protected]")
.call()
git.tag()
.setName("v${qqntVersion}-${project.version}")
.setName("v${qqntVersion}-${dockerImageVersion}")
.call()
git.push()
.also {
Expand Down

0 comments on commit 424a117

Please sign in to comment.