aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorligi <ligi@ligi.de>2018-05-09 07:13:53 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-05-09 07:13:53 +0800
commiteab6e5a317acf67409f82bc5c1f4d959413dfd47 (patch)
tree8ffb7cd4b55ff925ba77e82677ae31e208581fae /build
parentc4a4613d9504db43a26a3c79dda8bf6be0d1237a (diff)
downloaddexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar.gz
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar.bz2
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar.lz
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar.xz
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.tar.zst
dexon-eab6e5a317acf67409f82bc5c1f4d959413dfd47.zip
build: specify the key to use when invoking gpg:sign-and-deploy-file (#16696)
Diffstat (limited to 'build')
-rw-r--r--build/ci.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/build/ci.go b/build/ci.go
index 204c20675..79dcc146c 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -755,14 +755,18 @@ func doAndroidArchive(cmdline []string) {
os.Rename(archive, meta.Package+".aar")
if *signer != "" && *deploy != "" {
// Import the signing key into the local GPG instance
- if b64key := os.Getenv(*signer); b64key != "" {
- key, err := base64.StdEncoding.DecodeString(b64key)
- if err != nil {
- log.Fatalf("invalid base64 %s", *signer)
- }
- gpg := exec.Command("gpg", "--import")
- gpg.Stdin = bytes.NewReader(key)
- build.MustRun(gpg)
+ b64key := os.Getenv(*signer)
+ key, err := base64.StdEncoding.DecodeString(b64key)
+ if err != nil {
+ log.Fatalf("invalid base64 %s", *signer)
+ }
+ gpg := exec.Command("gpg", "--import")
+ gpg.Stdin = bytes.NewReader(key)
+ build.MustRun(gpg)
+
+ keyID, err := build.PGPKeyID(string(key))
+ if err != nil {
+ log.Fatal(err)
}
// Upload the artifacts to Sonatype and/or Maven Central
repo := *deploy + "/service/local/staging/deploy/maven2"
@@ -771,6 +775,7 @@ func doAndroidArchive(cmdline []string) {
}
build.MustRunCommand("mvn", "gpg:sign-and-deploy-file", "-e", "-X",
"-settings=build/mvn.settings", "-Durl="+repo, "-DrepositoryId=ossrh",
+ "-Dgpg.keyname="+keyID,
"-DpomFile="+meta.Package+".pom", "-Dfile="+meta.Package+".aar")
}
}