ci: Sign artifacts

This commit is contained in:
NotMyFault 2021-11-25 13:14:49 +01:00
parent 121bd58029
commit 22f52fc4e1
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import org.gradle.kotlin.dsl.invoke
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.the
import org.gradle.plugins.signing.SigningExtension
import javax.inject.Inject
@ -184,13 +185,15 @@ fun Project.applyLibrariesConfiguration() {
mapToMavenScope("runtime")
}
val publishingExtension = the<PublishingExtension>()
configure<SigningExtension> {
if (!version.toString().endsWith("-SNAPSHOT")) {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
isRequired
sign(tasks["publications"])
sign(publishingExtension.publications)
}
}

View File

@ -47,13 +47,15 @@ fun Project.applyPlatformAndCoreConfiguration() {
skip()
}
val publishingExtension = the<PublishingExtension>()
configure<SigningExtension> {
if (!version.toString().endsWith("-SNAPSHOT")) {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
isRequired
sign(tasks["publications"])
sign(publishingExtension.publications)
}
}