-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from sigstore/setup-signing
gpg and sigstore sign publications
- Loading branch information
Showing
4 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
build-logic/publishing/src/main/kotlin/build-logic.signing.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |