Skip to content

Commit 123ea84

Browse files
Merge pull request #1102 from watson-developer-cloud/release-docs
Update release documentation
2 parents 217bdc8 + bad878a commit 123ea84

File tree

6 files changed

+31
-36
lines changed

6 files changed

+31
-36
lines changed

.github/bintray-new-version.png

465 KB
Loading

.github/bintray-sync.png

309 KB
Loading

.github/bintray-upload-files.png

394 KB
Loading

RELEASE.md

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
1-
# Release Process
1+
# Release process
22

3-
* code: https://github.com/watson-developer-cloud/java-sdk
4-
* maven: http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22java-sdk%22
3+
The Java SDK has been configured so that releases should happen **automatically**.
54

6-
## Guide to uploading artifacts to the Central Repository
5+
If everything goes smoothly, commits to `master` should trigger new package versions using [semantic-release](https://github.com/semantic-release/semantic-release), which bases the release type (major, minor, patch, none) on the commit messages, which should always follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
76

8-
We use Sonatype as repository manager, it's used as the input channel for the Central Repository running the Sonatype Open Source Repository Hosting(OSSRH) service.
7+
When new versions are released, the code is pushed to Bintray and synced to Maven Central. The packages can be found [here](https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo) on Bintray and [here](https://search.maven.org/search?q=com.ibm.watson) on Maven Central.
98

10-
### Prerequisites
9+
The Javadocs for the new version should also be pushed automatically. Docs are located in the `gh-pages` branch of the repo, and that gets synced to the following GitHub Pages link: http://watson-developer-cloud.github.io/java-sdk/
1110

12-
If you are not familiar with Sonatype and/or the maven release process please read the following material:
11+
If things **don't** go smoothly, you'll need to follow some other instructions to get things in order.
1312

14-
* Sonatype: http://central.sonatype.org/pages/apache-maven.html
15-
* Releasing artifacts to Sonatype: http://kirang89.github.io/blog/2013/01/20/uploading-your-jar-to-maven-central/
16-
* Install GPG, and create a public key. More info: http://central.sonatype.org/pages/working-with-pgp-signatures.html
13+
## Fixing broken releases
1714

18-
### Releasing
19-
As part of your PR into `master` for a release, make a commit updating version number strings across the SDK. To do this, we use [bumpversion](https://github.com/peritus/bumpversion).
15+
### Travis timeouts
2016

21-
To use `bumpversion`, simply run the following command with the proper semantic version for your desired release:
22-
```bash
23-
bumpversion major|minor|patch
24-
```
17+
The most common reason for a release to fail is because of a Travis timeout. Builds are only allowed to run for a maximum of 1 hour, and unfortunately the syncing process between Bintray and Maven Central can be slow enough to go over this time limit sometimes. If this happens, you should do the following:
2518

26-
After you've merged your PR and After the `master` branch successfully builds from the release changes, check out the `master` branch and perform a release deployment to OSSRH (Staging) with:
27-
```bash
28-
gradle release
29-
```
30-
You will have to answer prompts for versions and tags. That will tag and commit a new version into your repository automatically.
19+
- Navigate to the code on Bintray at [this URL](https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo). If you're not a member of the ibm-cloud-sdks organization, ask the maintainer of this SDK repo for access.
20+
- Navigate to the "Maven Central" tab in each of the packages that didn't sync. Here's an example: https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo/com.ibm.watson%3Alanguage-translator#central. You can figure out which packages to sync manually by checking the failed Travis build log or by looking at the "Last Synced" date for the package.
21+
- Click the "Sync" button. If you need to provide Sonatype credentials, you can also ask the maintainer of this SDK repo for those.
3122

32-
After the above commits pass, `git checkout` the new tag branch for your release. In that branch, execute the following command:
23+
<img alt="Bintray sync" width="600" src="./.github/bintray-sync.png">
3324

34-
```bash
35-
./gradlew uploadArchives -Psigning.keyId=<keyId> -Psigning.password=<keyPassword> -Psigning.secretKeyRingFile=<pathToKeyRingFile> -PossrhUsername=<sonatypeUsername> -PossrhPassword=<sonatypePassword>
36-
```
25+
- After doing this with all of the necessary packages, you can verify that things worked by checking the available versions on [Maven Central](https://search.maven.org/search?q=com.ibm.watson). This could take up to an hour.
3726

38-
The arguments should be populated with the following:
39-
- `-Psigning.keyId`: The ID of your public key you created after following the link in the prerequisites
40-
- `-Psigning.password`: Your password you created for making public GPG keys
41-
- `-Psigning.secretKeyRingFile`: After creating your public key, you create your keyring file with the following command and use the absolute path to your new file:
27+
### Unsuccessful Bintray deployment
4228

43-
```bash
44-
gpg --export-secret-keys -o <outputFilename>.gpg
45-
```
29+
This case is much more unlikely, since integration tests don't run on `master` and builds are very unlikely to be passing in a PR but fail once it's merged. Nevertheless, if this does happen and files aren't deployed to Bintray, you'll need to follow some steps to do this manually:
4630

47-
- `-PossrhUsername`: Your Sonatype username
48-
- `-PossrhPassword`: Your Sonatype password
31+
- Navigate to the code on Bintray at [this URL](https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo). If you're not a member of the ibm-cloud-sdks organization, ask the maintainer of this SDK repo for access.
32+
- For each package in the SDK, if the new version isn't present, you can add it by navigating to the package and adding it manually:
4933

50-
Assuming this command works properly, you should be able to then log into Sonatype and close and release the repository.
34+
<img alt="Bintray new version" width="600" src="./.github/bintray-new-version.png">
35+
36+
- To add the files, make sure to first generate all of the necessary artifacts locally. Check out the new release tag and generate them with the following commands (from the SDK repo):
37+
```
38+
git checkout {release tag}
39+
./gradlew shadowJar
40+
```
41+
- In the new version of the package on Bintray, add the files with the "Upload Files" button. Follow the file structure of previous releases to ensure everything works properly. The files to add should be in the `build/libs` folder of each local package in the SDK.
42+
43+
<img alt="Bintray upload files" width="600" src="./.github/bintray-upload-files.png">
44+
45+
- Finally, be sure to sync the artifacts with Maven Central. You can look at the [Travis timeouts](#travis-timeouts) section above for more information on this.

secrets.tar.enc

0 Bytes
Binary file not shown.

visual-recognition/src/test/java/com/ibm/watson/visual_recognition/v4/VisualRecognitionIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class VisualRecognitionIT extends WatsonServiceTest {
6161
private static final String VERSION = "2019-02-11";
6262
private static final String RESOURCE = "src/test/resources/visual_recognition/v4/";
6363

64-
private static final String COLLECTION_ID = "684777e5-1f2d-40e3-987f-72d36557ef46";
64+
private static final String COLLECTION_ID = "10e96193-0e08-406b-b8fb-b5b9ea9fe99a";
6565
private static final String GIRAFFE_CLASSNAME = "giraffe";
6666
private static final String SINGLE_GIRAFFE_IMAGE_PATH = RESOURCE + "giraffe_to_classify.jpg";
6767
private static final String GIRAFFE_POSITIVE_EXAMPLES_PATH = RESOURCE + "giraffe_positive_examples.zip";

0 commit comments

Comments
 (0)