Skip to content

Latest commit

 

History

History
94 lines (80 loc) · 3.4 KB

RELEASE.md

File metadata and controls

94 lines (80 loc) · 3.4 KB

Release Instructions

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>

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)

Deploy to Sonatype

  • Update all pom.xml files in the package to the release version you want. Submit a pull request, get it reviewed, and submit
  • mvn clean install deploy -DperformRelease=true
  • Verify the result here
    • If there is a problem, undo by mvn nexus-staging:drop
  • mvn nexus-staging:release -DperformRelease=true
  • Update all pom.xml files to the new snapshot version (unless it's a bugfix release, we update from 0.4.0 to 0.5.0-SNAPSHOT)

Publish the release

  • 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 the release button just below the top tabs
  • It will take some time (up to 10 minutes) for the package to transition

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