publish-plugin icon indicating copy to clipboard operation
publish-plugin copied to clipboard

Creating a GitHub Actions workflow with the plugin.

Open TheOnlyTails opened this issue 3 years ago • 12 comments

I'm working on creating a workflow, but I don't know how to pass in the required signing parameter (which usually get passed as Gradle properties). Is there a way to do that with the plugin?

TheOnlyTails avatar Apr 09 '21 06:04 TheOnlyTails

See this example: https://github.com/kit-data-manager/nexus-publish-example

DavideD avatar Apr 09 '21 09:04 DavideD

@DavideD Thanks, just a short question. What about the secret key ring file?

TheOnlyTails avatar Apr 09 '21 11:04 TheOnlyTails

I set this up prior to that example, which is probably identical. If I recall correctly, you use the signingKey with useInMemoryPgpKeys instead of the key ring file. The signingKey and signingPassword are stored as secrets.

ben-manes avatar Apr 10 '21 20:04 ben-manes

Thanks. Do you know how I can get the signing key (I've already generated a pair)?

TheOnlyTails avatar Apr 11 '21 09:04 TheOnlyTails

@DavideD documented the steps which was nice of him.

gpg --armor --export-secret-keys $ID > ascii.key

ben-manes avatar Apr 11 '21 09:04 ben-manes

Thank you so much! I'll check it out!

TheOnlyTails avatar Apr 11 '21 17:04 TheOnlyTails

Weird - when I put my private key in (whether with or without newlines), I get an error (this is without newlines):

Cause: invalid armor

full log: https://gist.github.com/TheOnlyTails/69a172fa3638a46a3acaf6c75b5e60d1

TheOnlyTails avatar Apr 11 '21 18:04 TheOnlyTails

Have you tried to test what was proposed here:

https://github.com/HandBrake/HandBrake/issues/1608

ThomasJejkal avatar Apr 12 '21 11:04 ThomasJejkal

I finally had the idea to try printing the key when signing it, and turns out that if I pass it as a property, it gets cut off, like this:

lWWGBGByDfwBDADB5pWxgBT04U0bDIv/Pv0zDEYqKXt2Dubj3RcvCDAveel3eYFs

When the actual key is much, much longer.

TheOnlyTails avatar May 06 '21 11:05 TheOnlyTails

Have you checked the original key at the position where it stops in the output? Is there any carriage return or line feed character?

You may try this suggestion at StackOverflow in order to get rid of line breaks. I hope this helps.

ThomasJejkal avatar May 06 '21 12:05 ThomasJejkal

I regenerated the keys and tried again with that format, but for some reason, it still reads that one. Even weirder - when I close the repo manually, it works fine.

TheOnlyTails avatar May 06 '21 17:05 TheOnlyTails

If you're supplying signing key etc as GitHub secrets, those need to be Base64 encoded. See this project for a fully working solution. I had created https://github.com/gradle-nexus/publish-plugin/issues/85 which would alleviate the signing issue, although there's little movement on that ticket.

asarkar avatar May 09 '21 03:05 asarkar