mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-14 12:40:10 +08:00
[build] Use snapshot version from build index
This commit is contained in:
parent
e3891c0388
commit
77132eee41
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2022 Mamoe Technologies and contributors.
|
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||||
*
|
*
|
||||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||||
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||||
@ -104,19 +104,19 @@ tasks.register("updateSnapshotVersion") {
|
|||||||
result.assertNormalExitValue()
|
result.assertNormalExitValue()
|
||||||
|
|
||||||
val resultString = out.toByteArray().decodeToString()
|
val resultString = out.toByteArray().decodeToString()
|
||||||
val index = resultString
|
val branchAndIndex = resultString
|
||||||
.substringAfter("<SNAPSHOT_VERSION_START>", "")
|
.substringAfter("<SNAPSHOT_VERSION_START>", "")
|
||||||
.substringBefore("<SNAPSHOT_VERSION_END>", "")
|
.substringBefore("<SNAPSHOT_VERSION_END>", "")
|
||||||
|
|
||||||
logger.info("Exec result:")
|
logger.info("Exec result:")
|
||||||
logger.info(resultString)
|
logger.info(resultString)
|
||||||
|
|
||||||
if (index.isEmpty()) {
|
if (branchAndIndex.isEmpty()) {
|
||||||
throw GradleException("Failed to find version.")
|
throw GradleException("Failed to find version.")
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Snapshot version index is '$index'")
|
logger.info("Snapshot version index is '$branchAndIndex'")
|
||||||
val versionName = "${Versions.project}-$branch-${index}"
|
val versionName = "${Versions.project}-${branchAndIndex}"
|
||||||
|
|
||||||
// Add annotation on GitHub Actions build
|
// Add annotation on GitHub Actions build
|
||||||
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
|
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
|
||||||
|
@ -41,7 +41,7 @@ object GetNextSnapshotIndex {
|
|||||||
}
|
}
|
||||||
println()
|
println()
|
||||||
|
|
||||||
println("<SNAPSHOT_VERSION_START>${index.value}<SNAPSHOT_VERSION_END>")
|
println("<SNAPSHOT_VERSION_START>$branch-${index.value}<SNAPSHOT_VERSION_END>")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user