Repository navigation
WIP: Prepare for the deployment onto Sonatype Nexus - #187
Conversation
KengoTODA
commented
Jun 9, 2021
- sign files to meet a requirement from Sonatype
- deploy to Sonatype Nexus and close its staging repository automatic by io.github.gradle-nexus.publish-plugin
|
@cpovirk Are you familiar with GitHub Secrets?
If everything works well, we'll see that the artifact is signed with gpg automatically. Note that this PR contains nothing that enables deployment to Sonatype Nexus at this moment. |
|
Thanks! I didn't get a chance to do that today, but I will get to it next week. |
|
I'm sorry for not getting to this last week. I finally looked at it earlier today. While I haven't found a direct statement from our security people about this, I have read enough that I'm nervous about uploading the PGP key because of the possibility of a GitHub compromise or other incident. Is it possible to skip signing for snapshot releases? If Sonatype requires signing even for snapshot releases, we could skip snapshots entirely: Our annotations change infrequently, so we can afford to manually push new releases after any major change. And for the final release, I assume we can run the build manually and enter the passphrase when required? |
|
(It looks like the build script already skips signing if the key is unavailable, so maybe all we'd need is a way to prompt for the passphrase during a release to Central?) |
I think it's not possible. I've checked several snapshots at https://s01.oss.sonatype.org/content/repositories/snapshots/ and found that they has |
No. What we need to release to Central (via Sonatype Nexus) is just Sonatype user name and password. So if we don't want to upload the GPG key to GitHub Secrets, we need to handle release procedure manually in your local. I personally don't prefer this way, because it limits who can release and maintain the project. SpotBugs team forked FindBugs because the owner was inactive even though he kept release privilege to himself. And each OSS project has a risk to be so. Of course I can understand your security concerns. Recently we had a case that leaked env var at Codecov, actually. |
|
Sorry for dropping this again. I had forgotten about the history of FindBugs :( We definitely do not want to repeat that. While I remain nervous about uploading GPG keys, given my lack of security knowledge, I do want to make sure that multiple people can publish. If worst comes to worst, I'd expect that the various people who have write access to this repo can prove ownership to Sonatype through the usual process of pushing files to the repo. But there is no reason to wait for a problem to arise. I had requested a couple other owners when I filed the Sonatype ticket, but it's not clear to me that Sonatype gave permissions to anyone but me. I will post on the ticket to see if they will grant more permissions there or if we need to file new tickets. In the meantime, this PR looks good to me. I think we could merge it as it is, and that would unblock manual deployment. If we're leaving out the GPG keys, then we could even simplify the PR slightly by omitting the |
|
Some notes, which we should eventually turn into documentation for the release process: The ultimate command line [edit: after setting the version number in a detached head to be tagged later, ideally in a fresh clone of the repo] is something like this [edit: after #860 changes from the plugin we used for 1.0.0 to the one we used for 1.0.1!]: [edit: For the 1.0.1 release, I had also included [edit: [edit: Once upon a time, we needed In that command, Those instructions also include an Another setup step: Create Note that the command above deploys to and closes the staging repository, but it does not perform a release to Maven Central. If we want, we should be able to perform the release by changing [edit: the command somehow or other]. Naturally, I haven't wanted to try that yet :) To examine the staging repository, you can [edit: log into https://central.sonatype.com/ and go to "Publish" (near the top right) and then "Deployments."] Again, there should be no need to look here if we [edit: someday, maybe!] have Gradle release the artifacts for us. But it is good to know about for testing [edit: and for the release process as it stands today]. Plus, if there are errors (you know, hypothetically :)), those errors appear on that site under the Activity tab for a repository. [edit: Or I assume that they show up there somewhere now; the system has changed since I had problems with the 1.0.0 release, and 1.0.1 didn't hit any problems during this step.] General documentation for the Gradle plugin we're using is available at Other notes: If you get something wrong with the signing Finally, the command above passes your PGP passphrase twice as command-line arguments. I've set mine up so that the passphrase comes from a script, which can be as simple as [edit: We should also update documentation for each new release and of course publish release notes from a tag we push. Some of us might also want to quickly adopt the new version in our libraries/tools, perhaps following on testing that we conducted beforehand.] [edit: A release is probably also not a bad time to update the copies of our annotations in our |
|
OK, Sonatype said there was some kind of bug that prevented others from being given permissions initially. They've now added the other people, whom I roped in from other projects where we already shared permissions. We could use some non-Google members if you (Kengo) or others are interested. |
we'll handle release procedure manually, so no need to handle GPG in the workflow
|
OK, thanks. I've removed GPG related process from the workflow :)
At this moment I don't need the permission to deploy :) Thanks for your consideration! |
|
Thanks. I see that this PR is still marked as a draft, but it sounds to me like it's ready, so I'm going to merge it. If I'm wrong about that, do let me know, and we can revert it or fix forward as needed. |