This is a guide for Couchbase employees. It describes how to cut a release of this project and publish it to the Maven Central Repository.
You will need:
- The
gpgcommand-line program and a PGP key. Mac users, grabgpgfrom https://gpgtools.org and enjoy this setup guide. Generate a PGP key with yourcouchbase.comemail address and uploaded it to a public keyserver. For bonus points, have a few co-workers sign your key. - To tell git about your signing key:
git config --global user.signingkey DEADBEEF(replaceDEADBEEFwith the id of your PGP key). - A local Docker installation, if you wish to run the integration tests.
Start by checking the snapshot builds found here to ensure that everything looks good with the current commit.
To run the integration tests, run mvn clean verify
without specifying a profile.
When you're satisfied with the test results, it's time to...
- Edit
pom.xmland remove the-SNAPSHOTsuffix from the version string. - Edit
examples/pom.xmland update thedcp.client.versionproperty to match the version string in Step 1. - Commit these changes, with message "Prepare x.y.z release" (where x.y.z is the version you're releasing). Note: the snapshot build for that commit will fail because we removed the snapshot suffix. This is expected.
Run the command git tag -s x.y.z (where x.y.z is the release version number).
Use the previous version's tag message (e.g. git show 0.11.0) as a template for
the new version's tag message and then push the tag.
Run the release workflow found here supplying the tag name you previously pushed.
Increment the version number in pom.xml and restore the -SNAPSHOT suffix.
Update the dcp.client.version property in examples/pom.xml to refer to the
new snapshot version.
Commit and push to Gerrit. Breathe in. Breathe out.
- Take another look at the Prerequisites section. Did you miss anything?
- This gist has some tips for making git and gpg play nice together.
- If deployment fails because the artifacts are missing PGP signatures, make sure your Maven
command line includes
-Prelease(or-Pstage) when runningmvn deploy. Note that this is a profile so it's specified with-P.