- Create a Sonatype Account using your
@sky.uk
email address: https://issues.sonatype.org/secure/Signup!default.jspa - Create a Jira issue requesting access to the
uk.sky
group id: https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=11003&pid=10134
- Install GPG
Red Hat / CentOS:
yum install gnupg
Ubuntu / Debian:
apt-get install gnupg
Mac OS X
brew install gnupg
- Generate a signing key, selecting option 1 (RSA and RSA) for the kind of key you want:
gpg --full-generate-key
- Export your key:
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
- Take note of the last 8 characters of the key, for example if this was the output:
pub rsa3072 2021-11-16 [SC]
5E323D1244C346B15FBF73A210F0219E5BEFCDB2
uid John Smith <[email protected]>
sub rsa3072 2021-11-16 [E]
Take note of 5BEFCDB2
. This is your signing key ID and needs to be provided when uploading to Maven Central.
- Distribute your public key:
gpg --keyserver keyserver.ubuntu.com --send-keys 5E323D1244C346B15FBF73A210F0219E5BEFCDB2
More info on the above steps can be found here https://central.sonatype.org/publish/requirements/gpg/.
We use axion-release which relies on semantic versioning and git tags.
Get the current version:
./gradlew currentVersion
To simply release a bug fix and update the patch version run:
./gradlew check release
To bump the minor or major version (when adding functionality or breaking backwards compatibility):
./gradlew check release -Prelease.forceVersion=1.0.0
- To upload all artifacts to Maven Central run:
./gradlew uploadArchives -PossrhUsername=your-jira-id -PossrhPassword=your-jira-password -Psigning.keyId=YourKeyId -Psigning.password=YourPublicKeyPassword -Psigning.secretKeyRingFile=PathToYourKeyRingFile
signing.password
should be set to the password you used when generating your signing keysigning.secretKeyRingFile
should be the path to yoursecring.gpg
file e.g.~/.gnupg/secring.gpg
- The above properties can alternatively be stored in your systems
~/.gradle/gradle.properties
file
- Login to https://s01.oss.sonatype.org/ using the Sonatype account you created earlier
- Click
Staging Repositories
in the left-hand sidebar - Find the version you wish to publish and review the details
- Click
Close
in the top bar menu - If Sonatype's automated checks are happy that the artifact meets the
requirements you should be able to click
Release
in the top bar menu - Once the artifact has been uploaded to Maven Central, you will need to create a release on GitHub:
7.1. Under Releases, click on Draft New Release
7.2. The title of the release should be the tag (eg. 1.0.0)
7.3. In the release notes, include a link to the uploaded artifact on Maven Central, and list all PRs that have been merged since the last release
More info on the above steps can be found here https://central.sonatype.org/publish/release/.