An ATproto social media client -- with an independent Appview.
at main 138 lines 5.4 kB view raw view rendered
1# OTA Deployments 2 3## Automatic internal OTAs 4 5OTA deployments to TestFlight/APK installs happen automatically upon all merges 6into main. In cases where the fingerprint diff shows incompatible native 7changes, a new client build will automatically be ran and deployed to TestFlight 8(iOS) or delivered in Slack (Android). 9 10## Production OTAs 11 12Production OTAs can only update the JavaScript bundle. Changes to native modules 13must be done as a full release cycle through the app stores. 14 15> [!TIP] 16> If you're using a TestFlight build, in order to reference the correct build 17> number and to verify the success of an OTA, you will need to delete the 18> TestFlight app itself, delete the Bluesky app entirely, and re-install from 19> the App Store. 20 21### 1. Find the build numbers 22 23Find the latest production build numbers for iOS and Android in Slack. These are 24spit out into `#bot-client-builds` after each release. You can also find this 25information under the `About` section in app settings. 26 27| Slack | In app | 28| ----- | ------ | 29| ![slack](./img/slack_client_builds.jpeg) | ![slack](./img/ios_settings_about.jpeg) | 30 31### 2. Ensure the release is tagged 32 33You need to ensure that the latest release was properly tagged using the format 34`1.X.0`. If the commit is not properly tagged, then the OTA deployment will 35simply fail since the GitHub Action will not be able to find a commit to 36fingerprint and diff against. 37 38### 3. Create an OTA branch 39 40Create a branch based off the last commit that was deployed in the most recent 41release. This could be the commit that was tagged `1.x.0`, or a later commit, 42but it **needs to be the tip of the latest production release** in any case. 43Double check yourself by ensuring that the `version` in `package.json` matches 44what's in the latest release. 45 46This new OTA branch should follow the format `1.X.0-ota-1`. If one or more OTAs 47have already been deployed for this release, incremement the branch name e.g. 48`1.x.0-ota-2`. 49 50### 4. Add commits to the OTA branch 51 52Cherry pick in the commits that need to be deployed on top of the most recent 53release or OTA. 54 55### 5. Manually set build numbers 56 57Log in to the EAS CLI with `eas login` and manually set the build numbers to the 58values you found in **Step 1**. 59 60```sh 61> npx eas build:version:set -p ios 62> 63> Project @blueskysocial/bluesky with bundle identifier "xyz.blueskyweb.app" is configured with buildNumber 1011. 64> ✔ What version would you like to set? … 1009 65> 66> npx eas build:version:set -p android 67> 68> Project @blueskysocial/bluesky with application ID "xyz.blueskyweb.app" is configured with versionCode 641. 69> ✔ What version would you like to set? … 639 70``` 71 72👉 **Save the previous values,** in this case `1011` and `641`, so you can reset 73them after the OTA completes. 74 75### 6. Run the GitHub actions 76You'll need to run two separate actions: one to deploy the iOS/Android OTA 77itself, and one to build the web Docker container. 78 79**For the iOS/Android OTA,** head to [Actions > Bundle and Deploy EAS 80Update](https://github.com/bluesky-social/social-app/actions/workflows/bundle-deploy-eas-update.yml) 81and run the action. 82 83| Steps | | 84| ----- | --- | 85| Select your OTA branch `1.x.0-ota-x`, select `production` in the dropdown, enter the git tag of the latest release `1.x.0`, and click "Run workflow" | ![workflow](./img/ota_action.png) | 86 87> [!NOTE] 88> If you do enter an incorrect version here, the deployment will either: 89> - Fail, because the action cannot find a commit with your misentered version 90> - Succeed, but with no users receiving the update. This is because the version 91> you entered will not properly correlate to a _build number_ as well, so no 92> clients in the wild will be able to receive the update. 93 94**For web,** head to [Actions > 95build-and-push-bskyweb-aws](https://github.com/bluesky-social/social-app/actions/workflows/build-and-push-bskyweb-aws.yaml) 96and run the action. 97 98| Steps | | 99| ----- | --- | 100| Select your OTA branch `1.x.0-ota-x` and click "Run workflow" | ![workflow](./img/web_action.png) | 101 102### 7. Deploy web 103 104Once the web Docker container build finishes, go to your `1.x.0-ota-x` branch, 105copy the most recent commit hash. Post this hash in `#ops-deploys` and request 106someone with web deploy access deploy the built container. 107 108### 8. Confirm successful deployment 109 110In about five minutes, the new deployment should be deployed and devices will 111begin downloading and installing in the background. 112 113To confirm this, as mentioned above, you must completely clear the TestFlight 114build from your device and re-install from the App Store. Then, you'll need to: 115- Launch the app (or quit and reopen) and wait ~15s for the download to complete 116- Quit and reopen the app 117- Check the `Settings > About` page and confirm the has matches the most recent has on your OTA branch 118 119### 9. Reset build numbers 120 121Grab the build numbers you saved in **Step 5** and reverse the EAS CLI commands 122to reset the build numbers. 123 124```sh 125> npx eas build:version:set -p ios 126> 127> Project @blueskysocial/bluesky with bundle identifier "xyz.blueskyweb.app" is configured with buildNumber 1009. 128> ✔ What version would you like to set? … 1011 129> 130> npx eas build:version:set -p android 131> 132> Project @blueskysocial/bluesky with application ID "xyz.blueskyweb.app" is configured with versionCode 639. 133> ✔ What version would you like to set? … 641 134``` 135 136## Overview diagram 137 138![OTA Deployment](./img/ota-flow.png)