# Deploying to Play Store

## Sandbox app

* The Sandbox app is automatically deployed to the Play Store, every night at 10pm IST.
* We do this using [Tramline](https://www.tramline.app/) and GitHub Actions
* There is a "Scheduled Build" that runs every night at 10pm on the `master` branch
* No other manual intervention is required.

<figure><img src="/files/gNQ3xxONMjFnggvBNpBp" alt=""><figcaption></figcaption></figure>

## Staging / Demo

* The staging/demo app is automatically deployed to the Play Store, every 2 weeks at 9am IST.
* We do this using [Tramline](https://www.tramline.app/) and GitHub Actions
* There is a "Scheduled Build" that runs every 2 weeks at 9am on the `master` branch
* No other manual intervention is required.

<figure><img src="/files/NVFy14XS3r0tlW2V9NlO" alt=""><figcaption></figcaption></figure>

## Production

Our releases happens at regular intervals. For now, this interval is one (sometimes two) week, and Monday is release day.

Our integration branch is `master`: this is where PRs are merged, and release branches are made from. All release branches have a one-week holding period, during which we manually verify the app (using [Simple Demo](https://play.google.com/store/apps/details?id=org.simple.clinic.staging)) before it goes live on the [production app](https://play.google.com/store/apps/details?id=org.simple.clinic).

### Step 1: Production release

1. On release day (currently Monday), go to Simple (Production) app on Tramline.
2. Click on "Prepare new release" and select "New calendar version". This will create the appropriate release branch on the repository.
3. While the release build is being generated update the changelog on Tramline that will be passed to Google Play.
4. Once release build is available, submit the app for approval from "Approval" section on Tramline, and then start the rollout at 25%.
5. The CHANGELOG.md file must also be updated [on master](https://github.com/simpledotorg/simple-android/blob/master/CHANGELOG.md) itself. This keeps the entire team informed about which changes are already present on Demo.
6. Post the details of this release to the `#releases` Slack channel to inform the rest of the organisation.

### Step 2: Fix issues, if any

* If someone discovers a problem in the Demo/Production release, it must be fixed and merged into the appropriate release branch. Tramline will automatically create a new release based on the fix.
* Only a few categories of issues are eligible for cherry-picking: bug fixes and language/text changes. All other types of issues will have to wait till the next release goes out.
* Once the release is marked as finished, Tramline will automatically merge the fix back to the main branch.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.simple.org/engineering/android/deploying-to-play-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
