mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Merge branch 'gpg'
This commit is contained in:
parent
e1002cf60f
commit
bced7bdc33
3 changed files with 23 additions and 7 deletions
|
@ -97,6 +97,12 @@ project.ext {
|
||||||
file("$rootDir/dist/changelogs/${versionString}.md") :
|
file("$rootDir/dist/changelogs/${versionString}.md") :
|
||||||
file("$rootDir/dist/changelogs/${canonicalVersionString}.md")
|
file("$rootDir/dist/changelogs/${canonicalVersionString}.md")
|
||||||
incrementalChangelogFile = file("$rootDir/dist/changelogs/${canonicalVersionString}_incremental.md")
|
incrementalChangelogFile = file("$rootDir/dist/changelogs/${canonicalVersionString}_incremental.md")
|
||||||
|
signingKeyId = project.hasProperty('signingKeyId') ? project.property("signingKeyId") : System.getenv('GPG_KEY_ID')
|
||||||
|
signingKey = project.hasProperty('signingKeyFile') ? file(project.property("signingKeyFile")).text : System.getenv('GPG_KEY')
|
||||||
|
signingPassword = project.hasProperty('signingKeyPassword') ? project.property("signingKeyPassword") : System.getenv('GPG_KEY_PASSWORD')
|
||||||
|
if (signingPassword == null) {
|
||||||
|
signingPassword = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (org.gradle.internal.os.OperatingSystem.current() == org.gradle.internal.os.OperatingSystem.LINUX) {
|
if (org.gradle.internal.os.OperatingSystem.current() == org.gradle.internal.os.OperatingSystem.LINUX) {
|
||||||
|
|
17
dist/build.gradle
vendored
17
dist/build.gradle
vendored
|
@ -5,6 +5,7 @@ plugins {
|
||||||
id 'org.jreleaser' version '1.8.0'
|
id 'org.jreleaser' version '1.8.0'
|
||||||
id("com.netflix.nebula.ospackage") version "11.4.0"
|
id("com.netflix.nebula.ospackage") version "11.4.0"
|
||||||
id 'org.gradle.crypto.checksum' version '1.4.0'
|
id 'org.gradle.crypto.checksum' version '1.4.0'
|
||||||
|
id 'signing'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -36,7 +37,7 @@ task createChecksums(type: Checksum) {
|
||||||
doLast {
|
doLast {
|
||||||
def artifactChecksumsSha256Hex = new HashMap<String, String>()
|
def artifactChecksumsSha256Hex = new HashMap<String, String>()
|
||||||
for (final def file in outputDirectory.get().getAsFileTree().files) {
|
for (final def file in outputDirectory.get().getAsFileTree().files) {
|
||||||
if (file.toString().endsWith('mapping.map')) {
|
if (file.toString().endsWith('mapping.map') || file.toString().endsWith('.asc')) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,4 +91,18 @@ if (rootProject.fullVersion) {
|
||||||
apply from: 'choco.gradle'
|
apply from: 'choco.gradle'
|
||||||
apply from: 'winget.gradle'
|
apply from: 'winget.gradle'
|
||||||
apply from: 'install.gradle'
|
apply from: 'install.gradle'
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
|
||||||
|
}
|
||||||
|
|
||||||
|
task signArtifacts(type: Sign) {
|
||||||
|
def dir = layout.buildDirectory.dir("dist/artifacts").get()
|
||||||
|
dir.asFileTree.files.forEach {sign(it)}
|
||||||
|
}
|
||||||
|
|
||||||
|
task signChecksums(type: Sign) {
|
||||||
|
def checksums = layout.buildDirectory.file("dist/checksums/sha256sums.txt").get().asFile
|
||||||
|
sign(checksums)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,8 @@ publishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def signingKeyId = project.hasProperty('signingKeyId') ? project.property("signingKeyId") : System.getenv('GPG_KEY_ID')
|
|
||||||
def signingKey = project.hasProperty('signingKeyFile') ? file(project.property("signingKeyFile")).text : System.getenv('GPG_KEY')
|
|
||||||
def signingPassword = project.hasProperty('signingPassword') ? project.property("signingPassword") : System.getenv('GPG_KEY_PASSWORD')
|
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword != null ? signingPassword : '')
|
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
|
||||||
|
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue