mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1# OTA Deployments
2
3## Overview
4
5
6
7## Internal Deployments
8
9Internal OTA deployments should be performed automatically upon all merges into main. In cases where the fingerprint
10diff results in incompatible native changes, a new client build will automatically be ran and deployed to TestFlight
11(iOS) or delivered in Slack (Android).
12
13## Production Deployments
14
15### Prerequisites
16
17- Find the latest production build number for both iOS and Android in Slack. These are listed in #client-builds
18 - Production builds always send the Version Number and Build Number in the Slack message. Search for the latest
19 production version number, and you should find the correct information.
20
21 
22
23- It may also be useful to check the current production clients for these values. This will also help for testing. Note
24that you will need to _fully_ remove the existing internal client build from your device, otherwise the given values in
25the app may differ from the actual production values.
26
27 
28
29- You should have signed in to EAS locally through npx eas login. You will need to modify the build number in a
30subsequent step.
31- Ensure that the commit the initial client was cut from is properly tagged in git. The tag should be in the format of 1.X.0
32 - Note: If the commit is not properly tagged, then the OTA deployment will simply fail since the GitHub Action will
33 not be able to find a commit to fingerprint and diff against.
34
35### Preparation
36
37- Create a new branch from the git tag that the initial release was cut from if no OTA deployment has been made yet for this
38client. Name this branch `1.X.0-ota-1`
39- If a deployment has been made previously for this release, increment the branch name, i.e. `1.x.0-ota-2`
40- If necessary, cherry-pick the commit(s) that you wish to deploy
41- Ensure that the package.json’s version field is set to the appropriate value. As long as used the correct git tag
42to create your branch from, this should be properly set.
43
44### Deployment
45
46- Update the build number through EAS to match the build numbers of the
47 production iOS/Android apps
48 - Note: This isn’t strictly necessary, but having a step that takes you off of GitHub and into the terminal provides
49 a little “friction” to avoid fat fingering a release. Since there are legitimate reasons to just “click and deploy”
50 for internal builds, I felt it useful to make sure it doesn’t accidentally become a prod deployment.
51 - Set the build numbers to the values found in the prerequisite steps. Again, this should be the
52 build number for the current production release you want to deploy for.
53 - `npx eas build:version:set -p ios`
54 - `npx eas build:version:set -p android`
55 - These steps should spit out what the current build number is, save those values
56 for later too
57- Run the deployment
58 - Navigate to https://github.com/bluesky-social/social-app/actions/workflows/bundle-deploy-eas-update.yml
59 - Select the “Run Workflow” dropdown
60
61 
62
63 - Select the branch for the deployment you are releasing.
64
65 
66
67 - Double check the branch selection.
68 - Select the production channel
69 - Enter the version for the client you are releasing to, i.e. 1.80.0
70 - Note: If you do enter an incorrect version here, the deployment will either:
71 - Fail because the action cannot find a commit with your misentered version
72 - Succeed - but with no users receiving the update. This is because the version you entered will not properly
73 correlate to a _build number_ as well, so no clients in the wild will be able to receive the update.
74
75 
76
77 - Triple check the branch selection.
78 - You selected the correct branch
79 - You selected the "Production" channel
80 - You entered the correct version in the format of `1.X.0`.
81 - Press “Run Workflow”
82
83In about five minutes, the new deployment should be available for download. To test:
84
85- Remove the internal build of the app from your device
86- Download the app from the App Store/Google Play
87- Launch the app once and wait approximately 15 seconds
88- Relaunch the app
89- Check the Settings page and scroll to the bottom. The commit hash should now be the latest commit on your deployed branch.
90
91### Post Deployment
92
93- Reset both platforms build numbers to what they were before the OTA
94 deployment. These values should have been logged by the EAS CLI when you
95 reset them to the production values prior to OTA.