@@ -755,14 +755,17 @@ func doAndroidArchive(cmdline []string) {
755
755
os .Rename (archive , meta .Package + ".aar" )
756
756
if * signer != "" && * deploy != "" {
757
757
// Import the signing key into the local GPG instance
758
- if b64key := os .Getenv (* signer ); b64key != "" {
759
- key , err := base64 .StdEncoding .DecodeString (b64key )
760
- if err != nil {
761
- log .Fatalf ("invalid base64 %s" , * signer )
762
- }
763
- gpg := exec .Command ("gpg" , "--import" )
764
- gpg .Stdin = bytes .NewReader (key )
765
- build .MustRun (gpg )
758
+ b64key := os .Getenv (* signer )
759
+ key , err := base64 .StdEncoding .DecodeString (b64key )
760
+ if err != nil {
761
+ log .Fatalf ("invalid base64 %s" , * signer )
762
+ }
763
+ gpg := exec .Command ("gpg" , "--import" )
764
+ gpg .Stdin = bytes .NewReader (key )
765
+ build .MustRun (gpg )
766
+ keyID , err := build .PGPKeyID (string (key ))
767
+ if err != nil {
768
+ log .Fatal (err )
766
769
}
767
770
// Upload the artifacts to Sonatype and/or Maven Central
768
771
repo := * deploy + "/service/local/staging/deploy/maven2"
@@ -771,6 +774,7 @@ func doAndroidArchive(cmdline []string) {
771
774
}
772
775
build .MustRunCommand ("mvn" , "gpg:sign-and-deploy-file" , "-e" , "-X" ,
773
776
"-settings=build/mvn.settings" , "-Durl=" + repo , "-DrepositoryId=ossrh" ,
777
+ "-Dgpg.keyname=" + keyID ,
774
778
"-DpomFile=" + meta .Package + ".pom" , "-Dfile=" + meta .Package + ".aar" )
775
779
}
776
780
}
0 commit comments