Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpg and sigstore sign publications #602

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-logic/publishing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ dependencies {
implementation(project(":basics"))
implementation(project(":jvm"))
implementation("dev.sigstore.build-logic:gradle-plugin")
implementation("dev.sigstore:sigstore-gradle-sign-plugin:0.5.0")
loosebazooka marked this conversation as resolved.
Show resolved Hide resolved
implementation("com.gradle.plugin-publish:com.gradle.plugin-publish.gradle.plugin:1.2.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("build-logic.java-library")
id("build-logic.reproducible-builds")
id("build-logic.publish-to-central")
id("build-logic.signing")
}

java {
Expand All @@ -17,3 +18,5 @@ publishing {
}
}
}

signing.sign(publishing.publications["mavenJava"])
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
id("signing")
id("dev.sigstore.sign")
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}

tasks.withType<Sign>().configureEach {
onlyIf("Is a release") {
project.hasProperty("release")
}
onlyIf("Signing is not skipped") {
!project.hasProperty("skipSigning")
}
onlyIf("PGP Signing is not skipped") {
!project.hasProperty("skipPgpSigning")
}
}

tasks.withType<dev.sigstore.sign.tasks.SigstoreSignFilesTask>().configureEach {
onlyIf("Is a release") {
project.hasProperty("release")
}
onlyIf("Signing is not skipped") {
!project.hasProperty("skipSigning")
}
onlyIf("Sigstore Signing is not skipped") {
!project.hasProperty("skipSigstoreSigning")
}
}
28 changes: 2 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
plugins {
id("build-logic.root-build")
// It does not support participating in precompiled script plugins
id("com.github.vlsi.stage-vote-release") version "1.90"
// The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
`embedded-kotlin` apply false
}

version = "${findProperty("version")}${releaseParams.snapshotSuffix}"

println("Building Sigstore Java $version")

releaseParams {
tlp.set("sigstore-java")
organizationName.set("sigstore")
componentName.set("sigstore-java")
prefixForProperties.set("s01")
svnDistEnabled.set(false)
sitePreviewEnabled.set(false)
nexus {
prodUrl.set(uri("https://s01.oss.sonatype.org"))
}
voteText.set {
"""
${it.componentName} v${it.version}-rc${it.rc} is ready for preview.

Git SHA: ${it.gitSha}
Staging repository: ${it.nexusRepositoryUri}
""".trimIndent()
}
}
val calculatedVersion = property("version") as String + (if (hasProperty("release")) "" else "-SNAPSHOT")

allprojects {
version = rootProject.version
version = calculatedVersion
}
Loading