EAS Workflows is a React Native CI/CD that helps you automate your development and release processes. You can do things like make development builds for your entire team. You can publish previews of every single new feature on every commit, and then your team can view them with a QR code.
Or you can deliver new code to your users with an over-the-air update, or with a set of new builds that you build and submit to stores. And you can decide this programmatically from within a workflow. And it doesn't stop there.
You can run custom code. You can sequence every job to run in parallel or in sequence, and even run simulators and emulators to do things like running Maestro tests. This is going to help you and your team deliver features automatically.
It'll make repeated processes across your team more consistent, and it'll also save you time. So let's talk about how to set up Workflows. What kinds of workflows most teams use, and how you and your team can trigger them.
Let's jump right in. The first thing I'll need to do is set up my project with GitHub, and link my GitHub repo with my EAS project. I can do that by going into my account and then my project settings, and down here under GitHub.
Here I can search for a repository. This one is called QRU. It's a QR code reading app.
Okay, so I can go ahead and hit connect. And once I do, everything is now set up on EAS to start running workflows. So now let's talk about what we need to do to actually write the workflow files.
A great place to start is our examples doc. Here we've got some helpful examples like how to create development builds, how to publish preview updates, and also how to deploy to production. I've gone ahead and put all of these inside of a project, and here every single workflow goes under this .
eas/workflows directory. And then all of these Yaml files are those three different workflows we just saw. And here's what they look like.
The last part of setup that we need to do is for whatever workflows we have, if we have type build or type submit jobs, we'll need to go ahead and run EAS Build or EAS Submit for the profiles that those jobs are using before we're able to run this workflow. Once we've done that, we'll be all good to go. Okay, so let's run through each of these workflows and talk about why they'll be so helpful for you and your team.
The first workflow I want to talk about is creating development builds, because you're going to need to create development builds for you and your team. There are three different jobs here, each of which make a build that's signified by this type build property. This is a prepackaged job that's going to make an Android or iOS build for you.
I've got three here because the Android one is going to work for devices and emulators alike. And then I've got an iOS one that makes one for an iOS device, and then another iOS one that makes a build for simulators. So by kicking off this job, I can create all of my development builds at once and in parallel.
The second workflow I want to talk about is publishing preview updates. This enables that flow where on every single change that you make, you can publish changes, which takes usually about a minute to a minute and a half, and then your team can preview them by scanning a QR code on this particular one. I'm triggering this on every single push to every single branch, and then I've just got one job of type equals update, and it's going to use whatever branch as my update branch.
And so this allows me to get a unique URL for everybody who wants to preview my code. Finally, the last one and the most complex one, but this shows some of the power that you can get with Workflows is deployed to production. Now let's walk through this one a bit.
So if I have native changes to my app, it's going to determine whether I need to make a new build for the App Store or whether I should send an over-the-air update. And this workflow programmatically figures out which one I should do. It does that by running this job called fingerprint.
And this fingerprint looks at the native characteristics of my build, and it's able to figure out if I already have a build with the exact same native characteristics or the exact same runtime. And if I do, it's going to make a decision. So pretty much I get this fingerprint of my build, and then I can go see if I already have an Android and an iOS build of that native runtime.
Then if I don't have a build already, I'll go ahead and make builds for Android and iOS, and I'm also going to go submit them. But if those builds already exist in production and my users are already using them, I can go ahead and publish an over-the-air update instead, which is going to be much faster, and my users are going to get those changes more quickly. This makes it so that when I merge to main, the right thing is going to happen.
I'll either need to make a new submission with the app stores, or my users are just automatically going to get the latest changes pushed to their phone over the air. So let's talk about how to trigger these workflows. This is my development builds one again.
And this one is not triggered by GitHub. The best way to run this one is by using EAS CLI. I can do that by running eas workflow: run, and then the name of the Yaml file inside of .
eas/workflows. And when I do this it's going to upload my project to EAS. And it's going to run all of these builds for me on that command.
The other way to trigger these is through GitHub. And that's configured inside of the workflow files. So inside here I can say on push to every single branch.
And that means every time I push on GitHub we're going to see that event. And we'll go ahead and run this job. Similarly like this deploy to production workflow.
It says on pushes to the main branch please run all of these jobs which are going to figure out whether I need a new build or whether I can send an over-the-air update. EAS workflows is available now for both free and paid accounts. If you're on a free account, you can now automate your Build, Submissions and Updates with Workflows.
And if you're a subscriber, you can run custom scripts, you can run Maestro tests and more. I'll leave a link down below for our pricing and also our docs so that you can get started. In addition to the guides that I showed in this video, there's also a guide on how to upgrade from running EAS CLI commands locally.
So I hope you'll give it a try and let me know if you have questions or feedback. You can email us at workflows@expo. io.
So thanks for watching and I hope you have a great day!