mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Fix broken snapshot publishing (#4783)
This commit is contained in:
2
.github/workflows/deploy-snapshot.yaml
vendored
2
.github/workflows/deploy-snapshot.yaml
vendored
@@ -35,4 +35,4 @@ jobs:
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
with:
|
||||
arguments: publishAllPublicationsToSonatypeSnapshotRepository -Dsnapshot=true --stacktrace
|
||||
arguments: publishAllToSonatypeSnapshot -Dsnapshot=true --stacktrace
|
||||
|
||||
@@ -68,7 +68,7 @@ if (signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) {
|
||||
logger.info("GPG Key found - Signing enabled")
|
||||
signing {
|
||||
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||
sign(publishing.publications[DETEKT_PUBLICATION])
|
||||
publishing.publications.forEach(::sign)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ plugins {
|
||||
`java-gradle-plugin`
|
||||
`java-test-fixtures`
|
||||
idea
|
||||
signing
|
||||
alias(libs.plugins.pluginPublishing)
|
||||
// We use this published version of the Detekt plugin to self analyse this project.
|
||||
id("io.gitlab.arturbosch.detekt") version "1.20.0"
|
||||
@@ -157,3 +158,23 @@ with(components["java"] as AdhocComponentWithVariants) {
|
||||
withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() }
|
||||
withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }
|
||||
}
|
||||
|
||||
tasks.withType<Sign>().configureEach {
|
||||
notCompatibleWithConfigurationCache("https://github.com/gradle/gradle/issues/13470")
|
||||
}
|
||||
|
||||
val signingKey = "SIGNING_KEY".byProperty
|
||||
val signingPwd = "SIGNING_PWD".byProperty
|
||||
if (signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) {
|
||||
logger.info("Signing disabled as the GPG key was not found")
|
||||
} else {
|
||||
logger.info("GPG Key found - Signing enabled")
|
||||
afterEvaluate {
|
||||
signing {
|
||||
useInMemoryPgpKeys(signingKey, signingPwd)
|
||||
publishing.publications.forEach(::sign)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val String.byProperty: String? get() = findProperty(this) as? String
|
||||
|
||||
Reference in New Issue
Block a user