Hi, welcome to Automating React Native Deployments. I am Cecilia Martinez. I am a developer advocate for AppFlow, the CI CD platform built by Ionic. You can feel free to connect with me on Twitter or GitHub, at Cecilia Creates, or on LinkedIn using my name, Cecilia Martinez.
I'm here today to talk to you about shipping React Native apps, specifically the deployment process. For many developers the deployment process is very manual and very complex. You have to prepare your app code for distribution, you have to compile the signed native binary. You also have to deliver that native binary to the app stores, both for iOS and for Android, and deploy that to manual testers in order to actually make sure that your application works as expected. Once you've gone through all of that, you still have to publish your app for all users and ensure that you have ongoing support.
Now there are some benefits to implementing automation into this process. So in this talk we're going to review some ways that you can incrementally implement automation into certain high impact areas of the deployment process. First we'll start talking about configuration. So, one of the areas where you can implement automation in the configuration aspect is to auto-update configuration values like the Build ID. So typically for each new version of your application, you're going to want a fresh build number for iOS and a version code for Android. This can be very tedious to do manually, especially for React Native apps because you need to go into the source code for each of those platforms and update it. Being able to do this automatically in a CI environment makes it much easier and ensures that all your developers are on the same page.
To do this, you can use a tool like Trapeze. Trapeze is a free and open source tool built by Ionic. You can learn more at trapeze.dev. But Trapeze allows you to use YAML to create a file that contains instructions for how you'd like to configure native applications. In this case, we are using a CI build number environment variable. This is typically provided by your CI CD environment. Whether you're using GitHub Actions, CircleCI, or in this case, we're talking about AppFlow, you can update this to be whatever the CI build number environment variable is. We're then matching that CI build number to either the iOS build number or your Android version code, depending on what platform that you're building for. Then in your package.json for your React native app, you will have a script. In this case, we have a CI configure script that will run Trapeze and reference that CI.yaml file that we just looked at. Based on what platform that you're building for, again, this is an environment variable provided by your CI CD provider, you will update either that iOS build number or the Android version code. This is not only helpful to ensure that you always have a fresh build number but it's also good for things like debugging, for testing, and grabbing build blogs from your CI environment because it will always match up to the version code of your app.
Next let's talk about building. If you would decide to automate your build process, it can be really high impact because there's so much that goes into building for native iOS and Android.
Comments