mirror of
https://github.com/fankes/unmeta-gradle-plugin.git
synced 2025-09-05 10:35:16 +08:00
Setup publication to MavenCentral
This commit is contained in:
3
.github/workflows/publish-plugin.yaml
vendored
3
.github/workflows/publish-plugin.yaml
vendored
@@ -29,3 +29,6 @@ jobs:
|
|||||||
- name: Publish on Plugin Portal
|
- name: Publish on Plugin Portal
|
||||||
run: ./gradlew --project-dir plugin-build setupPluginUploadFromEnvironment publishPlugins
|
run: ./gradlew --project-dir plugin-build setupPluginUploadFromEnvironment publishPlugins
|
||||||
if: success()
|
if: success()
|
||||||
|
- name: Publish on Maven Central
|
||||||
|
run: ./gradlew --project-dir plugin-build publishMavenJavaPublicationToMavenRepository
|
||||||
|
if: success()
|
||||||
|
@@ -3,7 +3,9 @@
|
|||||||
<p>
|
<p>
|
||||||
|
|
||||||
[][actions]
|
[][actions]
|
||||||
|
[][releases]
|
||||||
[][pluginportal]
|
[][pluginportal]
|
||||||
|
[][mavencentral]
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -112,4 +114,6 @@ Feel free to open an issue or submit a pull request for any bugs/improvements.
|
|||||||
[1]: https://github.com/Kotlin/kotlinx.coroutines/issues/2267#issuecomment-698826645
|
[1]: https://github.com/Kotlin/kotlinx.coroutines/issues/2267#issuecomment-698826645
|
||||||
[debugmetadata]: https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/jvm/src/kotlin/coroutines/jvm/internal/DebugMetadata.kt
|
[debugmetadata]: https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/jvm/src/kotlin/coroutines/jvm/internal/DebugMetadata.kt
|
||||||
[pluginportal]: https://plugins.gradle.org/plugin/com.axzae.unmeta
|
[pluginportal]: https://plugins.gradle.org/plugin/com.axzae.unmeta
|
||||||
|
[mavencentral]: https://central.sonatype.com/artifact/com.axzae/unmeta
|
||||||
[actions]: https://github.com/axzae/unmeta-gradle-plugin/actions
|
[actions]: https://github.com/axzae/unmeta-gradle-plugin/actions
|
||||||
|
[releases]: https://github.com/axzae/unmeta-gradle-plugin/releases
|
||||||
|
@@ -6,3 +6,9 @@ DESCRIPTION=Remove @DebugMetadata annotation from your Kotlin classes
|
|||||||
WEBSITE=https://github.com/axzae/unmeta-gradle-plugin
|
WEBSITE=https://github.com/axzae/unmeta-gradle-plugin
|
||||||
VCS_URL=https://github.com/axzae/unmeta-gradle-plugin
|
VCS_URL=https://github.com/axzae/unmeta-gradle-plugin
|
||||||
IMPLEMENTATION_CLASS=com.axzae.unmeta.UnmetaPlugin
|
IMPLEMENTATION_CLASS=com.axzae.unmeta.UnmetaPlugin
|
||||||
|
# Maven Central POM
|
||||||
|
ORGANIZATION_NAME=Axzae
|
||||||
|
ORGANIZATION_URL=https://www.axzae.com
|
||||||
|
LICENSE_NAME=The MIT License
|
||||||
|
LICENSE_URL=https://opensource.org/license/mit/
|
||||||
|
DEVELOPER_NAME=You Qi
|
||||||
|
@@ -22,17 +22,68 @@ java {
|
|||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<KotlinCompile> {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("mavenJava") {
|
||||||
|
from(components["java"])
|
||||||
|
pom {
|
||||||
|
name.set(property("DISPLAY_NAME").toString())
|
||||||
|
description.set(property("DESCRIPTION").toString())
|
||||||
|
url.set(property("WEBSITE").toString())
|
||||||
|
|
||||||
|
organization {
|
||||||
|
name.set(property("ORGANIZATION_NAME").toString())
|
||||||
|
url.set(property("ORGANIZATION_URL").toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set(property("LICENSE_NAME").toString())
|
||||||
|
url.set(property("LICENSE_URL").toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scm {
|
||||||
|
val (vcsHost, vcsUser, vcsRepo) = property("VCS_URL").toString()
|
||||||
|
.substringAfter("https://")
|
||||||
|
.split("/")
|
||||||
|
url.set(property("VCS_URL").toString())
|
||||||
|
connection.set("scm:git:git://$vcsHost/$vcsUser/$vcsRepo.git")
|
||||||
|
developerConnection.set("scm:git:ssh://git@$vcsHost:$vcsUser/$vcsRepo.git")
|
||||||
|
}
|
||||||
|
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
name.set(property("DEVELOPER_NAME").toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
credentials {
|
||||||
|
username = System.getenv("SONATYPE_USERNAME")
|
||||||
|
password = System.getenv("SONATYPE_SECRET")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
val signingKey = System.getenv("GPG_SIGNING_KEY")
|
val signingKey = System.getenv("GPG_SIGNING_KEY")
|
||||||
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
|
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
|
||||||
useInMemoryPgpKeys(signingKey.chunked(64).joinToString("\n"), signingPassword)
|
useInMemoryPgpKeys(signingKey.chunked(64).joinToString("\n"), signingPassword)
|
||||||
sign(tasks["jar"])
|
sign(tasks["jar"])
|
||||||
}
|
sign(publishing.publications["mavenJava"])
|
||||||
|
|
||||||
tasks.withType<KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gradlePlugin {
|
gradlePlugin {
|
||||||
|
Reference in New Issue
Block a user