deepmedia / MavenDeployer

Release libraries to Maven Central (Nexus/OSSRH or Central Portal), GitHub Packages and local directories with a unified Gradle DSL. Includes automatic releases using Sonatype APIs.
https://opensource.deepmedia.io/deployer
73 stars 6 forks source link

Unable to load GPG key from local.properties #26

Closed sasa-b closed 1 week ago

sasa-b commented 1 week ago

Hey there, I've followed your blog post https://blog.deepmedia.io/post/how-to-publish-to-maven-central-in-2024 but no matter what I do I'm unable to load the GPG key.

I keep getting this error Cause: secret key ring doesn't start with secret key tag: tag 0xffffffff. With or without \n line character, I've tried escaping the \\n and putting the key between "" but it still doesn't help.

natario1 commented 1 week ago

Where are you loading the GPG key from?

sasa-b commented 1 week ago

@natario1 I tried loading it from local.properties / gradle.properties

I also tried populating the ENV as well with System.setProperty("SIGNING_KEY", File("key.txt").readText()) and removing it from local.properties but I got the same error.

natario1 commented 1 week ago

Here's how the key should look like in .properties files. Note that newlines are simple \n.

Beginning:

Screenshot 2024-11-12 alle 12 35 30

End:

Screenshot 2024-11-12 alle 12 35 59

If your key looks similar, maybe you are using the wrong password.

sasa-b commented 1 week ago

@natario1 thank you very much for the prompt responses, the issue was that I didn't start with the newline special character SIGNING_KEY=\n... 🤦‍♂️