Wikimedia Apps/Team/Android/App hacking/Publishing to Sonatype OSSRH

This is for our libraries; currently only java-mwapi but there could be more in the future.

Create GPG key
gpg --gen-key # Or gpg2 See hints at http://central.sonatype.org/pages/working-with-pgp-signatures.html#generating-a-key-pair.

Usually accept the default. But I would use the max value   for the requested keysize. Don't forget to add a passphrase.

Towards the end of the output you'll see the public key in a line similar to this: pub  4096R/F13983AB 2015-07-16 The highlighted portion would be your public key you want to enter in the signing config below as the .

Create a new Sonatype JIRA account
Sonatype account registration. Use these values for nexus* in the Signing configuration step below. This will be used for the   Gradle task. Hint: It's good to avoid special characters in the username and password that could be misinterpreted by Gradle or the shell.

Signing configuration
A GPG signature is necessary for signing but is independent of uploading. Add the following to your  : signing.keyId= signing.password= signing.secretKeyRingFile= nexusUsername= nexusPassword=

Snapshots
./gradlew clean build ./gradlew uploadArchives If this was done for the java-mwapi library you should see a new SNAPSHOT version on OSSRH.
 * Update the version in lib/build.gradle.
 * Execute the following commands

Promotion

 * 1) Merge snapshot code.
 * 2) Promote artifacts from the web interface. After uploading a non-snapshot version, click staging repositories and search for "mediawiki". Select the repository and and at the top click "close". After refreshing, click release.
 * 3) Push and +2 the two version bump patches.
 * 4) Push the version tag.
 * 1) Push and +2 the two version bump patches.
 * 2) Push the version tag.