How to Publish Android Library in Bintray using Travis CI

In this article, I am not going to write about how to create an android library or how to publish an android library rather than publish the library using Continuous integration. Because I found a simple way and sharing that with you all. I recommend to read the below articles. If you already know ignore it.

Before getting started,

Why Travis CI?

  • Travis CI is the most widely used automation tool in open source projects like Github, Bitbucket, etc.
  • It is totally free for unlimited public repositories.
  • Painless Integration.

In 5 Steps to integrate Travis CI for android library.

Let’s get started,

  1. First add below dependency in your Project build.gradle,

2. In library module build.gradle,

3. Integrate Travis CI in Github account,

  • Go to marketplace in Github account and search for Travis CI
Travis CI
  • Select Open source in Pricing and setup and click install it for free and its asking for Github authentication.
Pricing and setup

4. Integrate Travis CI in project,

  • Create .travis.yml file in root project folder, add the below lines,

5. Setup environment variable,

Before setup environment variable we need to get bintray user name and API key
  • Go to Bintray account, Select Edit profile will see your user name.
  • Then, Click API key and press show button it reveals the API key and copy it.
Bintray Api key
  • Go to Travis CI, Select your repo and click more option in this menu choose Settings
Choose settings
  • In Settings, Add environment variables
Add bintray username and API key.

That’s all 🙌. Commit your code build will started automatically.

Note: By default, Build started for every commit and pull request.

Thanks for reading this article…!

Please let me know if you have any suggestions or feedbacks.