chore(build): simplify library release signing setup

This commit is contained in:
Harsh Shandilya 2023-04-23 14:53:24 +05:30
parent 3c79106748
commit 57be46b590
No known key found for this signature in database
2 changed files with 2 additions and 13 deletions

View file

@ -25,5 +25,5 @@ jobs:
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.NEXUS_PUBLISH_GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.NEXUS_PUBLISH_GPG_KEY_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.NEXUS_PUBLISH_GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.NEXUS_PUBLISH_GPG_KEY_PASSWORD }}

View file

@ -11,9 +11,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
@Suppress("Unused")
class PublishedAndroidLibraryPlugin : Plugin<Project> {
@ -22,20 +19,12 @@ class PublishedAndroidLibraryPlugin : Plugin<Project> {
project.plugins.run {
apply(LibraryPlugin::class)
apply(MavenPublishPlugin::class)
apply(SigningPlugin::class)
apply("me.tylerbwong.gradle.metalava")
}
project.extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.DEFAULT, true)
signAllPublications()
}
project.afterEvaluate {
project.extensions.configure<SigningExtension> {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
project.extensions.configure<MetalavaExtension> {
documentation.set(Documentation.PUBLIC)
inputKotlinNulls.set(true)