There are multiple ways to push updates:
- Android Play Store/iOS App Store updates
- Relatively slow, especially for iOS, which requires App Store approval.
- Necessary for changes to native dependencies, permissions, etc.
- Should be used for significant code changes.
- AppCenter Codepush
- Much faster.
- Push updates to certain resources, namely Javascript code and some image assets, without the App Store process.
- Should be used largely for small changes like bugfixes.
We're keeping the versions of Android, iOS, and package.json equal. So, first, bump the app version:
yarn bumpVersion -r [major|minor|patch] --apply
This will increment the version for the iOS app, Android app, and package.json.
Add all the version bump changes to git
, and then commit it:
git commit -m "v0.1.2" # or whatever it is
git tag v0.1.2
git push
git push --tags
- Run
yarn config:deploy
. - If you have not already, create and install on your local machine a distribution certificate by following the instructions at: https://developer.apple.com/account/ios/certificate/ (NOTE: MAKE SURE YOU SECURE THIS CERTIFICATE, AS IT CAN BE USED TO PUSH UPDATES TO ALL OUR USERS. I saved mine in 1password and deleted the original file.)
- Download and copy
private.xcconfig
from Keybase intoios/BuildConfig
. It contains the iOS CodePush deployment keys. Make sure to reopen XCode to refresh the configurations. - Go to XCode
- Next to the Play and Stop buttons at the top, choose a device for the Raha
target that allows for publication. If you need to register a device, let me
know; but I think
Generic iOS Device
should work. - Click
Product -> Archive
. - Once archiving is done, click
Distribute App
- If you have a distribution certificate installed as described in the first step, you should be able to let Apple automatically manage signing when presented with that option.
- Once the upload is complete, wait for Apple to finish processing the app. (You can monitor this from the "Activity" tab of appstoreconnect.apple.com.)
- Then submit the app for review through
appstoreconnect.apple.com
.
- Download and copy the
release.keystore
from KeyBase somewhere locally and copy the signing and CodePush deployment keys fromgradle.properties
into your~/.gradle/gradle.properties
. Adjust the keystore path accordingly (use an absolute path). - Run
yarn bundle:android
to create a bundled and signed APK in./android/app/build/outputs/apk/prod/release/app-prod-release.apk
. - You can install this APK on your physical device through
adb install PATH.apk
. Do a sanity check pass to make sure the app doesn't break. - Submit the app through Google Play
Console
via
Release Management > App Releases > Production Track > Manage > Create Release
.
Minor JS updates can be deployed to the app without having to go through the App Store approval process by using codepush.
Note: new codepush releases are automatically targeted to the current version of the app, so we should never need to both release to codepush and publish to the app store.
- Make sure you have the latest dependencies installed by running
yarn install
. - Login to appcenter via
yarn run appcenter login
.
Under normal circumstances, we'd like to release to Android and iOS simultaneously to avoid versions getting out of sync.
TODO: Update what extraordinary circumstances are if we ever encounter them.
- Bump the codepush version using
yarn bumpVersion -r codepush --apply
- Build a pre-push Staging build.
- Run
yarn codepush:[android|ios]:release
. - Verify that your Staging build has received the new update.
- Once you've verified the update is working, run
yarn codepush:[android|ios]:promote
to promote the staging update to the Production environment. All app installs via the app stores should then receive this update. - Once you've promoted a codepush release, tag the current commit with the codepush release label with
git tag -a codepush-[android|ios]-[label]
. You can list the labels of production codepush releases by usingyarn codepush:[android|ios]:history:production
.
- Go to a commit without the new change but with the same app version number.
- Install a non-prod version via
./gradlew assembleDevProdRelease
, which is built with the Staging keys.
- Go to a commit without the new change but with the same app version number.
- In XCode, go to
Product -> Scheme -> Edit Scheme...
(all the way at the bottom) - Edit "Run" task (with the play button) "Build Configuration" to "Staging"
- Press the play button to install a bundled staging build onto your device
- This may have changed our default project scheme -- please revert these changes.