| 1 | Releasing RE2/J to Maven Central |
| 2 | ================================ |
| 3 | |
| 4 | This document describes the process for releasing RE2/J binary artifacts to |
| 5 | Maven Central and to the RE2/J GitHub site. |
| 6 | |
| 7 | # Prerequisites |
| 8 | |
| 9 | The following are one-time setup steps. You must have: |
| 10 | |
| 11 | * git |
| 12 | * an account on OSSRH, see the [initial setup |
| 13 | section](http://central.sonatype.org/pages/ossrh-guide.html#initial-setup) of |
| 14 | the OSSRH guide |
| 15 | * access to the `com.google.re2` OSSRH repository. For this, you should |
| 16 | request access by [filing a JIRA ticket](https://issues.sonatype.org/secure/CreateIssue!default.jspa) |
| 17 | with the OSSRH folks |
| 18 | * a GPG key (see below) |
| 19 | |
| 20 | ## GPG key |
| 21 | |
| 22 | You must create a GPG key for signing the RE2/J artifact. The key must be |
| 23 | published to one of the GPG keyservers, otherwise Sonatype will reject the |
| 24 | RE2/J artifact. |
| 25 | |
| 26 | ``` |
| 27 | $ gpg --gen-key |
| 28 | |
| 29 | ... follow the prompts |
| 30 | |
| 31 | $ gpg --list-keys |
| 32 | /home/sjr/.gnupg/pubring.kbx |
| 33 | ---------------------------- |
| 34 | pub rsa3072 2022-06-30 [SC] [expires: 2024-06-29] |
| 35 | ABCDEF01234567890ABCDEF01234567890ABCDEF |
| 36 | uid [ultimate] Your Name <[email protected]> |
| 37 | sub rsa3072 2022-06-30 [E] [expires: 2024-06-29] |
| 38 | |
| 39 | # Now send the key to the keyservers |
| 40 | |
| 41 | $ gpg --keyserver keys.openpgp.org --send-keys 90ABCDEF |
| 42 | gpg: sending key 1234567890ABCDEF to hkp://keys.openpgp.org |
| 43 | ``` |
| 44 | |
| 45 | # Making the release |
| 46 | |
| 47 | In a shell, change into the RE2/J source code root directory (the one |
| 48 | containing `build.gradle`). Then: |
| 49 | |
| 50 | * edit `build.gradle` and set `version` to the name of the next release |
| 51 | (e.g. "1.8"). |
| 52 | * change the download instructions in `README.md` to reflect the new version |
| 53 | number |
| 54 | * `git commit` the version name change |
| 55 | * `git tag re2j-<versionName>`, e.g. `git tag re2j-1.8` |
| 56 | * `git push --tags` |
| 57 | |
| 58 | Now you're ready to build and push the release. |
| 59 | |
| 60 | ``` |
| 61 | ./gradlew -Psonatype.username='sonatypeUsername' -Psonatype.password='sonatypeApiKey' \ |
| 62 | clean bintrayUpload |
| 63 | ``` |
| 64 | |
| 65 | Once successful, the new version needs to be published: |
| 66 | |
| 67 | 1. Log into the [Sonatype Nexus frontend](https://oss.sonatype.org/) |
| 68 | 2. Click on "Staging Repositories" on the left |
| 69 | 3. Select the latest staging repository, click "Close" |
| 70 | 4. If all of the repository checks pass, the repository will be closed. You can |
| 71 | now click "Release". This will send the artifact out to Maven Central, ready |
| 72 | for people to use. |
| 73 | |
| 74 | As a convenience to our users, you should also publish the sources, javadoc and |
| 75 | artifact JARs as GitHub releases. |
| 76 | |
| 77 | After this is all done, make an announcement on `[email protected]`. |
| 78 | |
| 79 | # Problems |
| 80 | |
| 81 | If you encounter issues, please reach out to the mailing list at |
| 82 | `[email protected]`. |