Skip to content

Release instructions

Josh Guilfoyle edited this page Sep 11, 2015 · 18 revisions

Select a version

Stetho releases follow the <major>.<minor>.<micro> versioning scheme where major version numbers denote substantial rewrites or major architectural shifts, minor versions represent new features or major bug fixes, and micro versions for bug fixes or small maintenance releases.

The previous maintainer expected the next release version to be specified in gradle.properties, suffixed with -SNAPSHOT. This is merely a hint as to what the next version might be, actual features landed may cause this version number to change. It is acceptable for the -SNAPSHOT version to be decremented.

Smoke test

  1. Make sure the full project builds:

./gradlew check connectedCheck ./gradlew installArchives ```

  1. Smoke test the sample app:

./gradlew installDebug ```

  1. If there are problems, abort the process and correct.

Release to GitHub

  1. Make sure you have upstream and origin remotes setup properly:

git remote -v

origin [email protected]:jasta/stetho.git (fetch) origin [email protected]:jasta/stetho.git (push) upstream https://github.com/facebook/stetho.git (fetch) upstream https://github.com/facebook/stetho.git (push) ```

  1. Update to the latest code locally:

git checkout master

git remote update upstream

git reset --hard upstream/master

```
  1. Sanity check by making sure the top commit is reasonably up-to-date:

git show HEAD


1. Start a release branch:

git checkout -b release-vX.Y.Z


1. Modify `CHANGELOG.md` by manually looking at changes from the previous release (typically the commits starting with "Merge pull request" provide sufficient information).

git log --format=oneline vX.Y.z..

[ edit CHANGELOG.md accordingly ]

git add CHANGELOG.md

git commit -m 'Update CHANGELOG.md to vX.Y.Z'


1. Modify all `README.md` to reflect the new version (the old version appears multiple times and there may be multiple files using them!).

1. Modify `gradle.properties` to cause the new version to be picked by by Maven/Gradle (make sure to drop `-SNAPSHOT`!):

VERSION_NAME=X.Y.Z


1. Officially bump the version:

git add -u

git commit -m 'Bump version to X.Y.Z'


1. Prepare a PR representing the release changes:

git push -u origin release-vX.Y.Z


1. Create the final release artifacts:

./gradlew clean assemble


1. If there are problems, correct on a different branch with different PRs and then merge them into the release branch!

1. Officially create the PR on github and merge.

1. Go to https://github.com/facebook/stetho/releases and click "Draft a new release".

1. Associate the release to a new tag, "`vX.Y.Z`", and use the title "Release X.Y.Z".  Leave the description section empty.

1. Attach the following JARs built locally:
 ```
stetho-X.Y.Z-fatjar.jar
stetho-X.Y.Z.jar
stetho-okhttp-X.Y.Z.jar
stetho-timber-X.Y.Z.jar
stetho-urlconnection-X.Y.Z.jar
stetho-js-rhino-X.Y.Z.jar
 ```

1. Save/submit the release.

# Release to Maven Central

1. Make sure you have an account with Maven Central by signing up for a JIRA account at: https://issues.sonatype.org/.

1. Create a `~/.gradle.properties` file with your credentials for Maven Central:
 ```
repositoryUsername=<yourusername>
repositoryPassword=<yourpassword>
 ```

1. Upload to the _staging_ area using:
 ```
# ./gradlew uploadArchives
 ```

1. Promote the staging release to a real release at: https://oss.sonatype.org/#stagingRepositories.  Find the `comfacebook-*` artifact that matches your upload and select "Close" on the top bar.  This step can take some time to verify the artifact.  Once closed, a "Release" button will be available on the top bar to finalize the process.

1. Habitually refresh http://repo1.maven.org/maven2/com/facebook/stetho/stetho/ until the release appears.

1. _Important_ - Remove the `~/.gradle.properties` file or at least comment out the username/password!  This is necessary because there doesn't seem to be a way to interactively prompt during `./gradlew uploadArchives` or use SSH keys or anything like that.

# Update the next `-SNAPSHOT` version

1. Edit `gradle.properties` and guess at the next version (usually just bumping the micro version number):
 ```
VERSION_NAME=X.Y.ZZ-SNAPSHOT
 ```

1. Commit as a PR:
 ```
git commit -m 'Update to X.Y.ZZ-SNAPSHOT'
git push -u origin snapshot-X.Y.ZZ
 ```

1. Go to github and merge the PR.

# Shout it!

Post to Google+ and Twitter using `#androiddev`!  If it's a big release, ask for a retweet from [@fbOpenSource](https://twitter.com/fbOpenSource).

# Further reading

The release and branching strategy that Stetho uses is based on: http://nvie.com/posts/a-successful-git-branching-model/

Integrating Stetho

Clone this wiki locally