From 77132eee41e42772330386bb92ffa933de519245 Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 21 Mar 2023 16:29:33 +0000 Subject: [PATCH] [build] Use snapshot version from build index --- ci-release-helper/build.gradle.kts | 10 +++++----- ci-release-helper/src/buildIndex/SnapshotVersions.kt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-release-helper/build.gradle.kts b/ci-release-helper/build.gradle.kts index 76d603b02..506c0869a 100644 --- a/ci-release-helper/build.gradle.kts +++ b/ci-release-helper/build.gradle.kts @@ -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 许可证的约束, 可以在以下链接找到该许可证. * 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() val resultString = out.toByteArray().decodeToString() - val index = resultString + val branchAndIndex = resultString .substringAfter("", "") .substringBefore("", "") logger.info("Exec result:") logger.info(resultString) - if (index.isEmpty()) { + if (branchAndIndex.isEmpty()) { throw GradleException("Failed to find version.") } - logger.info("Snapshot version index is '$index'") - val versionName = "${Versions.project}-$branch-${index}" + logger.info("Snapshot version index is '$branchAndIndex'") + val versionName = "${Versions.project}-${branchAndIndex}" // Add annotation on GitHub Actions build // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message diff --git a/ci-release-helper/src/buildIndex/SnapshotVersions.kt b/ci-release-helper/src/buildIndex/SnapshotVersions.kt index fc4614869..12fa1410e 100644 --- a/ci-release-helper/src/buildIndex/SnapshotVersions.kt +++ b/ci-release-helper/src/buildIndex/SnapshotVersions.kt @@ -41,7 +41,7 @@ object GetNextSnapshotIndex { } println() - println("${index.value}") + println("$branch-${index.value}") } } }