diff --git a/.github/workflows/deploy-maven-central.yml b/.github/workflows/deploy-maven-central.yml index 225f0d1..f106939 100644 --- a/.github/workflows/deploy-maven-central.yml +++ b/.github/workflows/deploy-maven-central.yml @@ -63,7 +63,7 @@ jobs: -PmavenCentralPassword=${{ secrets.MAVEN_PASSWORD }} -PsigningInMemoryKeyId=${{ secrets.MAVEN_GPG_KEY_ID }} -PsigningInMemoryPassword=${{ secrets.MAVEN_GPG_PASSPHRASE }} - publishAndReleaseToMavenCentral + :gradle-plugin:publishAndReleaseToMavenCentral env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/build.gradle.kts b/build.gradle.kts index 6a346b4..6eda5b7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,9 @@ -import com.vanniktech.maven.publish.SonatypeHost plugins { `kotlin-dsl` kotlin("multiplatform") version "2.0.21" apply false kotlin("jvm") version "2.0.21" apply false - application - signing id("io.github.gradle-nexus.publish-plugin") version "1.3.0" - id("com.vanniktech.maven.publish") version "0.29.0" } object Conf { @@ -61,62 +57,3 @@ repositories { } // Root project - only manages subprojects and Maven Central publishing configuration - - -publishing { - // Configure all publications - publications.withType { - pom { - artifactId = "net.kigawa.renlin-compiler.gradle.plugin" - name.set("net.kigawa.renlin-compiler.gradle.plugin") - description.set("Kotlin Compiler Plugin for automatic value injection with @AutoFill annotation") - url.set("https://github.com/Code-Sakura/renlin-compiler") - properties.set( - mapOf( - ) - ) - licenses { - license { - name.set("MIT License") - url.set("http://www.opensource.org/licenses/mit-license.php") - } - } - developers { - developer { - id.set("net.kigawa") - name.set("kigawa") - email.set("contact@kigawa.net") - } - developer { - id.set("io.github.seizavl") - name.set("seizavl") - email.set("") - } - } - scm { - connection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - developerConnection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") - url.set("https://github.com/Code-Sakura/renlin-compiler") - } - } - } -} - -signing { - if (project.hasProperty("mavenCentralUsername") || - System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null - ) { - useGpgCmd() - // It is not perfect (fails at some dependency assertions), better handled as - // `signAllPublications()` (as in vanniktech maven publish plugin) at build.gradle.kts. - //sign(publishing.publications) - } -} - -mavenPublishing { - publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) - if (project.hasProperty("mavenCentralUsername") || - System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null - ) - signAllPublications() -} \ No newline at end of file diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 45231de..6d212ff 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -1,6 +1,11 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { kotlin("jvm") `java-gradle-plugin` + application + signing + id("com.vanniktech.maven.publish") version "0.29.0" } group = "net.kigawa" @@ -40,7 +45,65 @@ kotlin { java { withSourcesJar() - withJavadocJar() } + + +publishing { + // Configure all publications + publications.withType { + pom { + artifactId = "net.kigawa.renlin-compiler.gradle.plugin" + name.set("net.kigawa.renlin-compiler.gradle.plugin") + description.set("Kotlin Compiler Plugin for automatic value injection with @AutoFill annotation") + url.set("https://github.com/Code-Sakura/renlin-compiler") + properties.set( + mapOf( + ) + ) + licenses { + license { + name.set("MIT License") + url.set("http://www.opensource.org/licenses/mit-license.php") + } + } + developers { + developer { + id.set("net.kigawa") + name.set("kigawa") + email.set("contact@kigawa.net") + } + developer { + id.set("io.github.seizavl") + name.set("seizavl") + email.set("") + } + } + scm { + connection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") + developerConnection.set("scm:git:https://github.com/Code-Sakura/renlin-compiler.git") + url.set("https://github.com/Code-Sakura/renlin-compiler") + } + } + } +} + +signing { + if (project.hasProperty("mavenCentralUsername") || + System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null + ) { + useGpgCmd() + // It is not perfect (fails at some dependency assertions), better handled as + // `signAllPublications()` (as in vanniktech maven publish plugin) at build.gradle.kts. + //sign(publishing.publications) + } +} + +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + if (project.hasProperty("mavenCentralUsername") || + System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername") != null + ) + signAllPublications() +} \ No newline at end of file