1*af546375SCole FaustOne-time setup 2*af546375SCole Faust============== 3*af546375SCole Faust 4*af546375SCole FaustSet up Sonatype Account 5*af546375SCole Faust----------------------- 6*af546375SCole Faust* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org) 7*af546375SCole Faust* Click *Sign Up* in the login box, follow instructions 8*af546375SCole Faust 9*af546375SCole FaustGet access to repository 10*af546375SCole Faust------------------------ 11*af546375SCole Faust* Go to [community support](https://issues.sonatype.org/browse/OSSRH) 12*af546375SCole Faust* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-16798) 13*af546375SCole Faust * You must be logged in to create a new issue 14*af546375SCole Faust * Use the *Create* button at the top tab 15*af546375SCole Faust 16*af546375SCole FaustSet up PGP keys 17*af546375SCole Faust--------------- 18*af546375SCole Faust* Install GNU Privacy Guard (GPG) 19*af546375SCole Faust * GPG is installed by default on Ubuntu systems 20*af546375SCole Faust * For other systems, see [GnuPG download page](https://www.gnupg.org/download/) 21*af546375SCole Faust 22*af546375SCole Faust* Generate the key ```gpg --gen-key``` 23*af546375SCole Faust 24*af546375SCole Faust * Keep the defaults, but specify a passphrase 25*af546375SCole Faust * The passphrase can be random; you just need to remember it long enough to finish the next step 26*af546375SCole Faust * One way to make a random passphrase: ```base64 /dev/urandom | head -c20; echo;``` 27*af546375SCole Faust 28*af546375SCole Faust* Find the ID of your public key ```gpg --list-secret-keys``` 29*af546375SCole Faust * Look for the line with format ```sec 2048R/ABCDEFGH 2015-11-17``` 30*af546375SCole Faust * The ```ABCDEFGH``` is the ID for your public key 31*af546375SCole Faust 32*af546375SCole Faust* Upload your public key to a public server: ```gpg --send-keys --keyserver hkp://pgp.mit.edu ABCDEFGH``` 33*af546375SCole Faust * If you see the error, `gpg: keyserver send failed: No data`, try again in ~5m. The mit server semi-frequently has trouble accepting keys 34*af546375SCole Faust 35*af546375SCole FaustCreate a Maven settings file 36*af546375SCole Faust---------------------------- 37*af546375SCole Faust* Create a file at ```$HOME/.m2/settings.xml``` with your passphrase and your sonatype username and password 38*af546375SCole Faust``` 39*af546375SCole Faust<settings> 40*af546375SCole Faust <profiles> 41*af546375SCole Faust <profile> 42*af546375SCole Faust <id>ossrh</id> 43*af546375SCole Faust <activation> 44*af546375SCole Faust <activeByDefault>true</activeByDefault> 45*af546375SCole Faust </activation> 46*af546375SCole Faust <properties> 47*af546375SCole Faust <gpg.executable>gpg</gpg.executable> 48*af546375SCole Faust <gpg.passphrase>[the password for your gpg key]</gpg.passphrase> 49*af546375SCole Faust </properties> 50*af546375SCole Faust </profile> 51*af546375SCole Faust </profiles> 52*af546375SCole Faust <servers> 53*af546375SCole Faust <server> 54*af546375SCole Faust <id>ossrh</id> 55*af546375SCole Faust <username>[your sonatype account name]</username> 56*af546375SCole Faust <password>[your sonatype account password]</password> 57*af546375SCole Faust </server> 58*af546375SCole Faust </servers> 59*af546375SCole Faust</settings> 60*af546375SCole Faust``` 61*af546375SCole Faust 62*af546375SCole FaustTo prepare a release 63*af546375SCole Faust==================== 64*af546375SCole Faust 65*af546375SCole FaustVersioning 66*af546375SCole Faust---------- 67*af546375SCole FaustMinor changes should be a point increase (0.6.0 -> 0.6.1). Additions to API or breaking changes should be 68*af546375SCole Fausta major release. (0.6.0 -> 0.7.0) 69*af546375SCole Faust 70*af546375SCole FaustPrepare release 71*af546375SCole Faust--------------- 72*af546375SCole Faust* Run `releasetool start`. Select "minor" or "patch" for the release type. This will bump the 73*af546375SCole Faust artifact versions, ask you to edit release notes, and create the release pull request. 74*af546375SCole Faust* Run `mvn clean install deploy -DperformRelease=true` to stage the release. 75*af546375SCole Faust* Verify the result [here](https://oss.sonatype.org/#nexus-search;quick~com.google.auth). 76*af546375SCole Faust * If there is a problem, undo by `mvn nexus-staging:drop`. 77*af546375SCole Faust 78*af546375SCole FaustPublish release 79*af546375SCole Faust--------------- 80*af546375SCole Faust* `mvn nexus-staging:release -DperformRelease=true` 81*af546375SCole Faust* It will take some time (10 minutes to 8 hours) for the package to be released 82*af546375SCole Faust* Confirm that the release appears in the [parent folder on Maven 83*af546375SCole FaustCentral](https://repo1.maven.org/maven2/com/google/auth/google-auth-library-parent/) 84*af546375SCole Faust* If the release doesn't show up, do the following to check for failures: 85*af546375SCole Faust * Go to [Sonatype](https://oss.sonatype.org/) and log in 86*af546375SCole Faust * Click on *Staging Repositories* on the left 87*af546375SCole Faust * Filter down to the repository by typing the package's groupId in the search box 88*af546375SCole Faust * In our case, `com.google.auth` 89*af546375SCole Faust * Click on the repository and check for errors 90*af546375SCole Faust* Submit the pull request to bump the version numbers 91*af546375SCole Faust* Update Javadoc on Github using `scripts/update_javadoc.sh`. 92*af546375SCole Faust* Run `releasetool tag` to create the GitHub release. 93*af546375SCole Faust* Run `releasetool start` to bump the next snapshot version. Select "snapshot" when prompted for 94*af546375SCole Faust the release type. This will bump the artifact versions and create a pull request. 95*af546375SCole Faust* Review and submit the PR. 96*af546375SCole Faust 97*af546375SCole FaustSpecial cases 98*af546375SCole Faust============= 99*af546375SCole Faust 100*af546375SCole FaustDeploying version not at the head of the repository 101*af546375SCole Faust--------------------------------------------------- 102*af546375SCole Faust* Check out the version you want to deploy 103*af546375SCole Faust * ```git checkout <ref>``` 104*af546375SCole Faust* Make sure all ```pom.xml``` file are not using ```SNAPSHOT``` versions 105*af546375SCole Faust* Proceed to **Deploy to Sonatype** 106