forked from googleapis/google-cloud-java
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request googleapis#41 from shinfan/dev
Add release instructions and make ossrhUsername/ossrhPassword optional.
- Loading branch information
Showing
2 changed files
with
95 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
###Overview | ||
|
||
Most of the release process is handled by the uploadArchives task. The task can be triggered by | ||
running "./gradlew uploadArchives" from the project's directory. A new artifact will be uploaded | ||
to the staging repository in Sonatype when "-SNAPSHOT" is not included in the version (as | ||
listed in the base directory's `pom.xml`). When "-SNAPSHOT" is included, the task only updates the | ||
artifact in the snapshot repository. | ||
|
||
###Release Instructions | ||
|
||
Set up Sonatype Account | ||
----------------------- | ||
* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org) | ||
* Click *Sign Up* in the login box, follow instructions | ||
|
||
Get access to repository | ||
------------------------ | ||
* Go to [community support](https://issues.sonatype.org/browse/OSSRH) | ||
* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-16798) | ||
* You must be logged in to create a new issue | ||
* Use the *Create* button at the top tab | ||
|
||
* Generate the key ```gpg --gen-key``` | ||
* Keep the defaults, but specify a passphrase | ||
|
||
* 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``` | ||
|
||
Add deploy credential settings | ||
------------------------ | ||
* Create a settings file at ```$HOME/.gradle/gradle.properties``` with your key information and your sonatype username/password | ||
|
||
signing.keyId=<YOUR-KEY-ID-HERE> | ||
signing.password=<YOUR-PASSWORD-HERE> | ||
signing.secretKeyRingFile=/usr/local/google/home/<YOUR-USER-NAME>/.gnupg/secring.gpg | ||
|
||
ossrhUsername=<YOUR-NEXUS-USERNAME> | ||
ossrhPassword=<YOUR-NEXUS-PASSWORD> | ||
|
||
Deploy to Sonatype | ||
------------------ | ||
* Update all ```pom.xml``` files in the package to the release version you want. Sumit a pull request, get it reviewed, and submit | ||
* ```mvn clean install deploy -DperformRelease=true``` | ||
* Verify the publishment [here](https://oss.sonatype.org/#nexus-search;quick~gax) | ||
* 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 | ||
|
||
Publish the release | ||
------------------- | ||
* Go to [Sonatype](https://oss.sonatype.org/) 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, ```comgoogleapi``` | ||
* Click the *release* button just below the top tabs | ||
* It will take some time (up to 10 minutes) for the package to transition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,46 +165,48 @@ signing { | |
sign configurations.archives | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name 'GAX (Google Api eXtensions)' | ||
packaging 'jar' | ||
artifactId 'gax' | ||
description 'Google Api eXtensions' | ||
url 'https://github.com/googleapis' | ||
pom.project { | ||
name 'GAX (Google Api eXtensions)' | ||
packaging 'jar' | ||
artifactId 'gax' | ||
description 'Google Api eXtensions' | ||
url 'https://github.com/googleapis' | ||
|
||
scm { | ||
url 'https://github.com/googleapis/gax-java' | ||
connection 'scm:svn:https://github.com/googleapis/gax-java.git' | ||
} | ||
scm { | ||
url 'https://github.com/googleapis/gax-java' | ||
connection 'scm:svn:https://github.com/googleapis/gax-java.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'BSD' | ||
url 'https://github.com/googleapis/gax-java/blob/master/LICENSE' | ||
licenses { | ||
license { | ||
name 'BSD' | ||
url 'https://github.com/googleapis/gax-java/blob/master/LICENSE' | ||
} | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'GoogleAPIs' | ||
name 'GoogleAPIs' | ||
email '[email protected]' | ||
url 'https://github.com/googleapis' | ||
organization 'Google, Inc.' | ||
organizationUrl 'https://www.google.com' | ||
developers { | ||
developer { | ||
id 'GoogleAPIs' | ||
name 'GoogleAPIs' | ||
email '[email protected]' | ||
url 'https://github.com/googleapis' | ||
organization 'Google, Inc.' | ||
organizationUrl 'https://www.google.com' | ||
} | ||
} | ||
} | ||
} | ||
|