Skip to content

Commit 8914ae4

Browse files
authored
chore(build): use in-memory key in CI (#2449)
1 parent ce23da1 commit 8914ae4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ private void configureAndroidLibrary(Project project) {
3131
project.android {
3232
defaultConfig {
3333
versionName rootProject.findProperty('VERSION_NAME')
34+
if (project.hasProperty('signingKeyId')) {
35+
System.out.println("Getting signing info from protected source.")
36+
project.ext.'signing.keyId' = findProperty('signingKeyId')
37+
project.ext.'signing.password' = findProperty('signingPassword')
38+
project.ext.'signing.inMemoryKey' = findProperty('signingInMemoryKey')
39+
}
3440
}
3541
}
3642
}

publishing.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ afterEvaluate { project ->
105105

106106
signing {
107107
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
108+
if (project.hasProperty('signing.inMemoryKey')) {
109+
def signingKey = findProperty("signing.inMemoryKey").replace("\\n","\n")
110+
def signingPassword = findProperty("signing.password")
111+
def keyId = findProperty("signing.keyId")
112+
useInMemoryPgpKeys(keyId, signingKey, signingPassword)
113+
}
108114
sign configurations.archives
109115
}
110116

0 commit comments

Comments
 (0)