Remove bintray

This commit is contained in:
Him188 2021-05-25 12:13:43 +08:00
parent 3584ca1e71
commit 5e25c0e25b
16 changed files with 10 additions and 147 deletions

View File

@ -40,21 +40,17 @@ jobs:
mkdir build-secret-keys
echo "$SONATYPE_USER" > build-secret-keys/sonatype.key
echo "$SONATYPE_KEY" >> build-secret-keys/sonatype.key
echo "$BINTRAY_USER" > build-secret-keys/bintray.key
echo "$BINTRAY_KEY" >> build-secret-keys/bintray.key
env:
GPG_PRIVATE: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PUBLIC_: ${{ secrets.GPG_PUBLIC_KEY }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
- name: Init gradle project
run: ./gradlew clean --scan
- name: Check keys
run: ./gradlew ensureBintrayAvailable ensureMavenCentralAvailable
run: ./gradlew ensureMavenCentralAvailable
- name: fillBuildConstants
run: >

View File

@ -6,7 +6,6 @@
----
![Gradle CI](https://github.com/mamoe/mirai/workflows/Gradle%20CI/badge.svg?branch=master)
[![Download](https://api.bintray.com/packages/him188moe/mirai/mirai-core/images/download.svg)](https://bintray.com/him188moe/mirai/mirai-core/)
[![Maven Central](https://img.shields.io/maven-central/v/net.mamoe/mirai-core-api.svg?label=Maven%20Central)](https://search.maven.org/search?q=net.mamoe%20mirai)
[![Gitter](https://badges.gitter.im/mamoe/mirai.svg)](https://gitter.im/mamoe/mirai?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![MiraiForum](https://img.shields.io/badge/post-on%20MiraiForum-yellow)](https://mirai.mamoe.net)

View File

@ -34,7 +34,6 @@ plugins {
kotlin("plugin.serialization") version Versions.kotlinCompiler
// id("org.jetbrains.dokka") version Versions.dokka
id("net.mamoe.kotlin-jvm-blocking-bridge") version Versions.blockingBridge
id("com.jfrog.bintray") // version Versions.bintray
id("com.gradle.plugin-publish") version "0.12.0" apply false
}
@ -80,8 +79,6 @@ allprojects {
// mavenLocal() // cheching issue cause compiler exception
// maven(url = "https://mirrors.huaweicloud.com/repository/maven")
jcenter()
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
maven(url = "https://kotlin.bintray.com/kotlinx")
google()
mavenCentral()
}

View File

@ -49,7 +49,6 @@ dependencies {
// compileOnly(kotlin("gradle-plugin-api", "1.3.72")) // Gradle's Kotlin is 1.3.72
api("com.jfrog.bintray.gradle", "gradle-bintray-plugin", version("bintray"))
api("com.github.jengelman.gradle.plugins", "shadow", version("shadow"))
api("org.jetbrains.kotlin", "kotlin-gradle-plugin", version("kotlinCompiler"))
api("org.jetbrains.kotlin", "kotlin-compiler-embeddable", version("kotlinCompiler"))

View File

@ -22,16 +22,7 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.registering
fun Project.configureRemoteRepos(
bintrayPkgName: String = "mirai-core"
) {
tasks.register("ensureBintrayAvailable") {
doLast {
if (!project.isBintrayAvailable()) {
error("bintray isn't available. ")
}
}
}
fun Project.configureRemoteRepos() {
tasks.register("ensureMavenCentralAvailable") {
doLast {
if (GpgSigner.signer == GpgSigner.NoopSigner) {
@ -63,22 +54,6 @@ fun Project.configureRemoteRepos(
} else {
println("SonaType is not available")
}
if (isBintrayAvailable()) {
maven {
name = "Bintray"
setUrl("https://api.bintray.com/maven/him188moe/mirai/$bintrayPkgName/;publish=1;override=1")
credentials {
username = Bintray.getUser(project)
password = Bintray.getKey(project)
}
}
} else {
println("bintray isn't available.")
}
}
}
}
@ -86,36 +61,11 @@ fun Project.configureRemoteRepos(
@Suppress("NOTHING_TO_INLINE")
inline fun Project.configurePublishing(
artifactId: String,
bintrayRepo: String = "mirai",
bintrayPkgName: String = artifactId,
vcs: String = "https://github.com/mamoe/mirai"
) {
configureRemoteRepos(
bintrayPkgName = bintrayPkgName
)
configureRemoteRepos()
apply<ShadowPlugin>()
if (project.isBintrayAvailable()) {
bintray {
user = Bintray.getUser(project)
key = Bintray.getKey(project)
setPublications("mavenJava")
setConfigurations("archives")
publish = true
override = true
pkg.apply {
repo = bintrayRepo
name = bintrayPkgName
setLicenses("AGPLv3")
publicDownloadNumbers = true
vcsUrl = vcs
}
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)

View File

@ -14,7 +14,6 @@ import org.gradle.api.publish.maven.MavenPublication
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.withType
fun logPublishing(message: String) {
println("[Publishing] Configuring $message")
@ -35,25 +34,6 @@ fun Project.configureMppPublishing() {
// tasks.findByName("generateMetadataFileForKotlinMultiplatformPublication")?.enabled = false // FIXME: 2021/1/21
}
tasks.withType<com.jfrog.bintray.gradle.tasks.BintrayUploadTask> {
doFirst {
publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
val artifact = (object :
org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
publication.artifact(artifact)
GpgSigner.signer.doSign(moduleFile)
publication.artifact(GPGSignMavenArtifact(artifact))
}
}
}
}
val stubJavadoc = tasks.register("javadocJar", Jar::class) {
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
archiveClassifier.set("javadoc")
@ -134,6 +114,6 @@ val publishPlatformArtifactsInRootModule: Project.(MavenPublication) -> Unit = {
}
}
public fun MavenArtifact.smartToString(): String {
fun MavenArtifact.smartToString(): String {
return "${file.path}, classifier=${classifier}, ext=${extension}"
}

View File

@ -33,13 +33,6 @@ import kotlin.reflect.KProperty
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
/**
* Configures the [bintray][com.jfrog.bintray.gradle.BintrayExtension] extension.
*/
@PublishedApi
internal fun Project.`bintray`(configure: com.jfrog.bintray.gradle.BintrayExtension.() -> Unit): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("bintray", configure)
@PublishedApi
internal operator fun <U : Task> RegisteringDomainObjectDelegateProviderWithTypeAndAction<out TaskContainer, U>.provideDelegate(
receiver: Any?,

View File

@ -37,7 +37,6 @@ object Versions {
const val androidGradlePlugin = "4.1.1"
const val android = "4.1.1.4"
const val bintray = "1.8.5"
const val shadow = "6.1.0"
const val slf4j = "1.7.30"

View File

@ -1,42 +0,0 @@
/*
* 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
import org.gradle.api.Project
fun Project.isBintrayAvailable() = Bintray.isBintrayAvailable(project)
@Suppress("DuplicatedCode")
object Bintray {
@JvmStatic
fun isBintrayAvailable(project: Project): Boolean {
return kotlin.runCatching {
getUser(project)
getKey(project)
}.isSuccess
}
@JvmStatic
fun getUser(project: Project): String {
return SecretKeys.getCache(project)
.loadKey("bintray")
.requireNotInvalid()
.user
}
@JvmStatic
fun getKey(project: Project): String {
return SecretKeys.getCache(project)
.loadKey("bintray")
.requireNotInvalid()
.password
}
}

View File

@ -8,14 +8,14 @@
有关各类版本的区别,参考 [版本规范](Evolution.md#版本规范)。通常建议选择最新稳定版本。
[Version]: https://api.bintray.com/packages/him188moe/mirai/mirai-core/images/download.svg?
[Bintray Download]: https://bintray.com/him188moe/mirai/mirai-core/
[Version]: https://img.shields.io/maven-central/v/net.mamoe/mirai-core-api.svg?label=Maven%20Central
[Central Download]: https://search.maven.org/search?q=net.mamoe%20mirai
| 版本类型 | 版本号 |
|:------:|:------------------------------:|
| 稳定 | 2.6.4 |
| 预览 | - |
| 开发 | [![Version]][Bintray Download] |
| 开发 | [![Version]][Central Download] |
### 配置项目
@ -121,6 +121,6 @@ dependencies {
非常不推荐这种方法,请尽可能使用构建工具。
在 [Jcenter](https://jcenter.bintray.com/net/mamoe/mirai-core-all/) 或 [阿里云代理仓库](https://maven.aliyun.com/repository/public/net/mamoe/mirai-core-all/) 下载指定版本的 `-all.jar` 文件,即包含 `mirai-core``mirai-core-api``mirai-core-utils` 和其他依赖。
在 [Maven Central](https://repo.maven.apache.org/maven2/net/mamoe/mirai-core-all/) 或 [阿里云代理仓库](https://maven.aliyun.com/repository/public/net/mamoe/mirai-core-all/) 下载指定版本的 `-all.jar` 文件,即包含 `mirai-core``mirai-core-api``mirai-core-utils` 和其他依赖。
> [回到 Mirai 文档索引](README.md#jvm-平台-mirai-开发)

@ -1 +1 @@
Subproject commit 94f54b7c6d5b44ba47d2a8a4f306f1c2ecc3956f
Subproject commit 410cdd02efaa70ed5a64603d121c44fd4f952985

View File

@ -1,5 +1,5 @@
/*
* 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.
@ -13,7 +13,6 @@ plugins {
kotlin("jvm")
kotlin("plugin.serialization")
`maven-publish`
id("com.jfrog.bintray")
id("net.mamoe.kotlin-jvm-blocking-bridge")
}

View File

@ -19,7 +19,6 @@ plugins {
id("net.mamoe.kotlin-jvm-blocking-bridge")
`maven-publish`
id("com.jfrog.bintray")
}
description = "Mirai API module"

View File

@ -18,7 +18,6 @@ plugins {
id("kotlinx-atomicfu")
id("net.mamoe.kotlin-jvm-blocking-bridge")
`maven-publish`
id("com.jfrog.bintray")
}
description = "mirai-core utilities"

View File

@ -17,7 +17,6 @@ plugins {
kotlin("plugin.serialization")
id("net.mamoe.kotlin-jvm-blocking-bridge")
`maven-publish`
id("com.jfrog.bintray")
}
description = "Mirai Protocol implementation for QQ Android"

View File

@ -14,10 +14,6 @@ pluginManagement {
mavenCentral()
jcenter()
google()
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
maven(url = "https://dl.bintray.com/kotlin/kotlin-dev")
maven(url = "https://dl.bintray.com/jetbrains/kotlin-native-dependencies")
maven(url = "https://kotlin.bintray.com/kotlinx")
}
}