The most part of the job is already automated for you. However, deployment to Maven Central requires some manual work from your side.
-
- Create an account at Sonatype issue tracker
-
- Create an issue to create new project for you
-
- You will have to prove that you own your desired namespace
-
- Create a GPG key with
gpg --gen-key
, use the same email address you used to sign up to the Sonatype Jira
- Create a GPG key with
-
- Find your key id in the output of the previous command looking like
D89FAAEB4CECAFD199A2F5E612C6F735F7A9A519
- Find your key id in the output of the previous command looking like
-
- Upload your key to a keyserver, for example
gpg --send-keys --keyserver keyserver.ubuntu.com "<your key id>"
-
- Now you should create secrets available to your GitHub Actions
- via
gh
command
gh secret set SIGNING_KEY -a actions --body "$(gpg --export-secret-key --armor "<KEY_ID>")"
gh secret set SIGNING_KEY_ID -a actions --body "<KEY_ID>"
gh secret set SIGNING_KEY_PASSWORD -a actions --body "<SECRET_PASSWORD>"
gh secret set MAVEN_CENTRAL_PASSWORD -a actions --body "<GENERATED_PASSWORD>"
gh secret set MAVEN_CENTRAL_USERNAME -a actions --body "<GENERATED_USERNAME>"
1- [ ] Deploy command
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache