|
| 1 | +How To Release |
| 2 | +============== |
| 3 | + |
| 4 | +Due to Maven Central's very particular requirements, the release process is a bit |
| 5 | +elaborate and requires a good deal of local configuration. This guide should walk |
| 6 | +you through it. It won't do anyone outside of KeepSafe any good, but the workflow |
| 7 | +is representative of just about any project deploying via Sonatype. |
| 8 | + |
| 9 | +We currently deploy to Maven Central (via Sonatype's OSS Nexus instance). |
| 10 | + |
| 11 | +### Prerequisites |
| 12 | + |
| 13 | +1. A *published* GPG code-signing key |
| 14 | +1. A Sonatype Nexus OSS account with permission to publish in com.getkeepsafe |
| 15 | +1. Permission to push directly to https://github.com/KeepSafe/TapTargetView |
| 16 | + |
| 17 | +### Setup |
| 18 | + |
| 19 | +1. Add your GPG key to your github profile - this is required |
| 20 | + for github to know that your commits and tags are "verified". |
| 21 | +1. Configure your code-signing key in ~/.gradle.properties: |
| 22 | + ```gradle |
| 23 | + signing.keyId=<key ID of your GPG signing key> |
| 24 | + signing.password=<your key's passphrase> |
| 25 | + signing.secretKeyRingFile=/path/to/your/secring.gpg |
| 26 | + ``` |
| 27 | +1. Configure your Sonatype credentials in ~/.gradle.properties: |
| 28 | + ```gradle |
| 29 | + SONATYPE_NEXUS_USERNAME=<nexus username> |
| 30 | + SONATYPE_NEXUS_PASSWORD=<nexus password> |
| 31 | + ``` |
| 32 | +1. Configure git with your codesigning key; make sure it's the same as the one |
| 33 | + you use to sign binaries (i.e. it's the same one you added to gradle.properties): |
| 34 | + ```bash |
| 35 | + # Do this for the TapTargetView repo only |
| 36 | + git config user.email "[email protected]" |
| 37 | + git config user.signingKey "your-key-id" |
| 38 | + ``` |
| 39 | + |
| 40 | +### Pushing a build |
| 41 | + |
| 42 | +1. Edit gradle.properties, update the VERSION property for the new version release |
| 43 | +1. Edit changelog, add relevant changes, note the date and new version (follow the existing pattern) |
| 44 | +1. Add new `## [Unreleased]` header for next release |
| 45 | +1. Verify that the everything works: |
| 46 | + ```bash |
| 47 | + ./gradlew clean check |
| 48 | + ``` |
| 49 | +1. Make a *signed* commit: |
| 50 | + ```bash |
| 51 | + git commit -S -m "Release version X.Y.Z" |
| 52 | + ``` |
| 53 | +1. Make a *signed* tag: |
| 54 | + ```bash |
| 55 | + git tag -s -a X.Y.Z |
| 56 | + ``` |
| 57 | +1. Upload binaries to Sonatype: |
| 58 | + ```bash |
| 59 | + ./gradlew publish |
| 60 | + ``` |
| 61 | +1. Go to [Sonatype](https://oss.sonatype.org/), log in with your credentials |
| 62 | +1. Click "Staging Repositories" |
| 63 | +1. Find the "comgetkeepsafe" repo, usually at the bottom of the list |
| 64 | +1. "Close" the repository (select it then click the "close" button up top), the text field doesn't matter so put whatever you want in it |
| 65 | +1. Wait until that's done |
| 66 | +1. "Release" the repository, leave the checkbox checked. Hooray, we're in Maven Central now! |
| 67 | +1. Push all of our work to Github to make it official. Check previous [releases](https://github.com/KeepSafe/TapTargetView/releases) and edit tag release changes: |
| 68 | + ```bash |
| 69 | + git push --tags origin master |
| 70 | + ``` |
0 commit comments