45

Continuous Integration for Google Play Apps

 5 years ago
source link: https://www.tuicool.com/articles/hit/iAFfEjq
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

At the last Google I/O conference, Google introduced version 3 of its Google Play Publishing API , which enables developers to publish their apps to Google Play from their continuous integration workflows.

The Google Play Publishing API makes it possible for developers to automate app distribution tasks, such as uploading a new version of an app, releasing an app to a specific track , and managing information displayed in the Play Store. Version 3 supports a number of operations that were previously only available through the Play Console , thus allowing to carry through entire workflows in a fully automated way.

The basic message format used by the Publishing API is the following:

{
  "track": "production",
  "releases": [
    {
      "name": "Release One", 
      "versionCodes": ["100"],
      "status": "completed"
    }
  ]
}

In addition to releasing to production , you can release to a testing track ( alpha or beta ) to provide access to your tester base. Additionally, you can deploy a new version of your app by doing a staged rollout , which ensure the new release is only available to a limited number of users. As you get more confident about your app quality, you can gradually increase the number of users that are included in the rollout. The following JSON message shows you how you can handle a staged rollout for a new release of an app:

{
  "track": "production",
  "releases": [
    {
      "versionCodes": ["100"],
      "status": "completed"
    },
    {
      "versionCodes": ["200"],
      "status": "inProgress",
      "userFraction": 0.1
    }
  ]
}

You can change the status to halted to quickly respond to any major issue you detect in the field.

Another interesting possibility offered by the Publishing API is creating a draft release which is only available when you log in to the Play Console. This makes it possible to automatically prepare a release but postpone its effective availability until a product manager explicitly approves it.

{
  "track": "production",
  "releases": [
    {
      "name": "Big Launch",
      "versionCodes": ["200"],
      "status": "draft"
    }
  ]
}

As a final note, you can also include release notes in any number of supported languages.

If you want to get started with the Publishing API, do not miss the sample code Google made available.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK