Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Prepare for Sonaype release #324

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Conversation

aSemy
Copy link
Collaborator

@aSemy aSemy commented Oct 10, 2022

add configuration required for Sonatype releases (signing, Javadoc jar, sources jar)

Signing artifacts is absolutely the worst part of Gradle I've seen. The provided plugins are all out of date, and can cause massive headaches. I've bashed my head against that wall many times, so hopefully this configuration works well.

I've not been able to run it yet because I don't have the signing tokens setup on my current machine, but here are the basic steps:

  1. Create a GPG key https://central.sonatype.org/publish/requirements/gpg/#why-do-we-have-requirements
  2. in $GRADLE_USER_HOME/gradle.properties, store the relevant properties
    signingKeyId=...
    signingPassword=...
    signingSecretKeyRingFile=...
  3. Create a Sonatype Jira account, and again store the user/pass in $GRADLE_USER_HOME/gradle.properties
    ossrhUsername=...
    ossrhPassword=...
  4. try running ./gradlew publishAllPublicationsToMavenProjectLocalRepository and seeing if the required .asc files are created

@sanity
Copy link
Member

sanity commented Oct 10, 2022

Let's see, I could create a GPG key and store the private key as a Github Actions secret? The sonatype username/password is already stored in MAVEN_PASSWORD and MAVEN_USERNAME.

@aSemy
Copy link
Collaborator Author

aSemy commented Oct 11, 2022

First I'd try it locally, then try setting it up in GitHub.

Because the properties come from providers.gradleProperty(), the properties can be defined either in a gradle.properties file, or as an environment variable prefixed with ORG_GRADLE_PROJECT_. So In GitHub I'd rename the environment variables to match this format.

@sanity sanity marked this pull request as ready for review October 21, 2022 21:52
@sanity sanity merged commit 7a94194 into kwebio:master Oct 21, 2022
@aSemy aSemy deleted the feat/sonatype_publish_prep branch October 22, 2022 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants