Skip to content

Latest commit

 

History

History
104 lines (90 loc) · 4.16 KB

RELEASE.md

File metadata and controls

104 lines (90 loc) · 4.16 KB

One-time setup

Set up Sonatype Account

  • Sign up for a Sonatype JIRA account here
  • Click Sign Up in the login box, follow instructions

Get access to repository

  • Go to community support
  • Ask for publish rights by creating an issue similar to this one
    • You must be logged in to create a new issue
    • Use the Create button at the top tab

Set up PGP keys

  • Install GNU Privacy Guard (GPG)

  • Generate the key gpg --gen-key

    • Keep the defaults, but specify a passphrase
    • The passphrase can be random; you just need to remember it long enough to finish the next step
    • One way to make a random passphrase: base64 /dev/urandom | head -c20; echo;
  • Find the ID of your public key gpg --list-secret-keys

    • Look for the line with format sec 2048R/ABCDEFGH 2015-11-17
    • The ABCDEFGH is the ID for your public key
  • Upload your public key to a public server: gpg --send-keys --keyserver hkp://pgp.mit.edu ABCDEFGH

Create a Maven settings file

  • Create a file at $HOME/.m2/settings.xml with your passphrase and your sonatype username and password
<settings>
  <profiles>
    <profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.executable>gpg</gpg.executable>
        <gpg.passphrase>[the password for your gpg key]</gpg.passphrase>
      </properties>
    </profile>
  </profiles>
  <servers>
    <server>
      <id>ossrh</id>
      <username>[your sonatype account name]</username>
      <password>[your sonatype account password]</password>
    </server>
  </servers>
</settings>

To prepare a release

Versioning

Minor changes should be a point increase (0.6.0 -> 0.6.1). Additions to API or breaking changes should be a major release. (0.6.0 -> 0.7.0)

Prepare release

  • Update all pom.xml files in the package to the release version you want.
  • Update version numbers appearing in README.md.
  • Submit a pull request, get it reviewed, but wait to submit it in case there are errors during publishing.
  • mvn clean install deploy -DperformRelease=true
  • Verify the result here.
    • If there is a problem, undo by mvn nexus-staging:drop.

Publish release

  • mvn nexus-staging:release -DperformRelease=true
  • It will take some time (10 minutes to 8 hours) for the package to be released
  • Confirm that the release appears in the parent folder on Maven Central
  • If the release doesn't show up, do the following to check for failures:
    • Go to Sonatype and log in
    • Click on Staging Repositories on the left
    • Filter down to the repository by typing the package's groupId without periods in the search box
      • In our case, comgoogleauth
    • Click on the repository and check for errors
  • Submit the pull request to bump the version numbers
  • Update Javadoc on Github using scripts/update_javadoc.sh.
  • On the releases page, create a corresponding Git tag (e.g., "v0.7.0") on the release commit, and summarize the commits since the last release. Follow the style of previous release notes.
  • Update all pom.xml files to the new snapshot version (increment patch version number, e.g., from 0.4.0 to 0.4.1-SNAPSHOT).
  • Submit a pull request, get it reviewed, and submit.

Special cases

Deploying version not at the head of the repository

  • Check out the version you want to deploy
    • git checkout <ref>
  • Make sure all pom.xml file are not using SNAPSHOT versions
  • Proceed to Deploy to Sonatype