diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65cc26e44..295aba77b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -119,3 +119,8 @@ jobs: # :mirai-console-gradle:publishPlugins --info --stacktrace # -Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} # -Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} + + - name: Gradle :ci-release-helper:closeAndReleaseRepository + run: > + ./gradlew + :ci-release-helper:closeAndReleaseRepository --info diff --git a/build.gradle.kts b/build.gradle.kts index b3f335cc8..ce6a72482 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -139,9 +139,9 @@ subprojects { tasks.register("cleanExceptIntellij") { group = "build" - allprojects.forEach { - if (it.name != "mirai-console-intellij") - dependsOn(it.tasks.findByName("clean")) + allprojects.forEach { proj -> + if (proj.name != "mirai-console-intellij") + proj.tasks.findByName("clean")?.let { dependsOn(it) } } } diff --git a/ci-release-helper/build.gradle.kts b/ci-release-helper/build.gradle.kts new file mode 100644 index 000000000..3a04e0834 --- /dev/null +++ b/ci-release-helper/build.gradle.kts @@ -0,0 +1,22 @@ +/* + * Copyright 2019-2021 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. + * + * https://github.com/mamoe/mirai/blob/master/LICENSE + */ +import keys.SecretKeys + +plugins { + id("io.codearte.nexus-staging") version "0.22.0" +} + +description = "Mirai CI Methods for Releasing" + +nexusStaging { + packageGroup = rootProject.group.toString() + val keys = SecretKeys.getCache(project).loadKey("sonatype") + username = keys.user + password = keys.password +} diff --git a/gradle.properties b/gradle.properties index 46f7e3f1c..122691870 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,12 @@ # -# Copyright 2019-2020 Mamoe Technologies and contributors. +# Copyright 2019-2021 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. # # https://github.com/mamoe/mirai/blob/master/LICENSE # + # style guide kotlin.code.style=official # config @@ -17,4 +18,5 @@ org.gradle.vfs.watch=true kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.native.enableDependencyPropagation=false #kotlin.mpp.enableGranularSourceSetsMetadata=true -systemProp.org.gradle.internal.publish.checksums.insecure=true \ No newline at end of file +systemProp.org.gradle.internal.publish.checksums.insecure=true +gnsp.disableApplyOnlyOnRootProjectEnforcement=true diff --git a/settings.gradle.kts b/settings.gradle.kts index cb6728cbf..4f6140571 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,6 +29,7 @@ include(":mirai-core") include(":mirai-core-all") include(":binary-compatibility-validator") +include(":ci-release-helper") fun includeConsoleProjects() {