EAS 工作流程简介
EAS Workflows 是一个 CI/CD 服务,用于自动化 React Native 和 Expo 应用的构建、更新、提交和测试。
EAS 工作流程 是 EAS(Expo 应用服务)提供的 CI/CD 服务,它让团队能够自动化重复任务,例如构建 Android 和 iOS 二进制文件、发布空中更新、提交到应用商店、使用 Maestro 运行端到端测试以及将 Web 应用部署到 EAS 托管服务。
EAS 工作流在受管的云环境中运行,提供专门为移动应用开发设计的预打包任务类型。当你的 EAS 项目与 GitHub 关联时,团队可以通过 GitHub 事件(推送、拉取请求、标签)或计划任务(cron)触发工作流,或者通过 EAS CLI 手动运行。
🌐 EAS Workflows run in managed cloud environments with pre-packaged job types designed specifically for mobile app development. When your EAS project is linked to GitHub, teams can trigger workflows from GitHub events (push, pull request, labels) or schedules (cron), or run them manually via the EAS CLI.

学习如何自动化每个应用开发团队必须处理的一些最常见的流程:创建开发版本、发布预览更新以及部署到生产环境。
快速开始
🌐 Quick start
信息 以下
eas命令需要 EAS CLI。有关更多信息,请参阅 如何安装 EAS CLI。
工作流在项目根目录下的 .eas/workflows/ 目录中以 YAML 文件的形式定义。每个文件都指定一个 name、可选的触发器 (on) 以及一个或多个在云端运行的 jobs。你可以使用 EAS CLI 通过以下命令运行工作流:
🌐 Workflows are defined as YAML files in the .eas/workflows/ directory at the root of your project. Each file specifies a name, optional triggers (on), and one or more jobs that run in the cloud. You can run a workflow with EAS CLI with the following command:
- eas workflow:run .eas/workflows/your-workflow.yml主要特点
🌐 Key features
- 为 React Native/Expo 预打包:提供现成可用的工作类型(
build、submit、update、maestro、deploy等),帮助简化实现复杂性 - 无需管理基础设施:在 EAS 上运行,支持 macOS 和 Linux 工作节点,因此无需维护 CI 服务器或配置 Android Studio/Xcode
- 统一的构建产物管理:所有构建产物、更新和日志都显示在 EAS 仪表板上
- GitHub 集成:在推送、拉取请求或标签事件时自动触发工作流,并支持分支和路径过滤
- 更快的迭代:将 Fingerprint、Get Build 和 Update 作业合并,以避免重复的原生构建,并在可能时发布 OTA(空中下载)更新
- 内置端到端测试:直接在工作流程中对 Android 模拟器和 iOS 模拟器运行 Maestro 测试
- Slack 通知:当工作流成功运行或失败时,将通知发送到 Slack 通道
- 重新打包:重用现有构建的元数据和 JavaScript 包,以更快地创建兼容的构建
工作流触发类型
🌐 Workflow trigger types
推动工作流程
🌐 Push workflows
在推送到匹配的分支或标签时运行。支持使用通配符模式进行分支、标签和路径过滤。
🌐 Run when commits are pushed to matching branches or tags. Supports branch, tag, and path filtering with glob patterns.
拉取请求工作流
🌐 Pull request workflows
在拉取请求被创建、更新或标记时运行。适用于合并前的预览构建和自动化测试。
🌐 Run when pull requests are opened, updated, or labeled. Useful for preview builds and automated testing before merge.
计划工作流
🌐 Scheduled workflows
在 cron 时间表上运行(例如,每夜构建或每周回归测试)。计划的工作流仅在默认分支上运行。
🌐 Run on a cron schedule (for example, nightly builds or weekly regression tests). Scheduled workflows run on the default branch only.
手动工作流程
🌐 Manual workflows
使用 eas workflow:run 命令按需运行。支持参数化输入以实现灵活执行。
🌐 Run on-demand using eas workflow:run command. Supports parameterized inputs for flexible execution.
何时使用 EAS 工作流程
🌐 When to use EAS Workflows
| Scenario | Recommendation |
|---|---|
| Automate Android and iOS builds for your Expo and React Native apps | |
| Submit builds to App Store and Google Play automatically | |
| Publish over-the-air updates on every commit or merge | |
| Run E2E tests with Maestro as part of CI | |
| Trigger builds and updates from GitHub push or pull request events | |
| Deploy web apps to EAS Hosting | |
| Use fingerprint-based logic to skip redundant native builds | |
| CI/CD without managing your own infrastructure or macOS machines | |
| Highly customized pipelines with non-EAS services (such as Docker, custom runners) | |
| Matrix builds with multiple configuration variations in parallel | |
| CI/CD for non-React Native projects |
常见问题
🌐 Frequently asked questions (FAQ)
工作流与其他持续集成服务相比如何?
EAS 工作流旨在帮助你和你的团队发布应用。它预先配置了预封装的作业类型,可以构建、提交、更新、运行 Maestro 测试等。所有作业类型都在 EAS 上运行,因此你只需管理一套 YAML 文件,所有作业运行生成的工件都会显示在 expo.dev 上。
🌐 EAS Workflows are designed to help you and your team release your app. It comes preconfigured with pre-packaged job types that can build, submit, update, run Maestro tests, and more. All job types run on EAS, so you'll only have to manage one set of YAML files, and all the artifacts from your job runs will appear on expo.dev.
其他持续集成服务,比如 CircleCI 和 GitHub Actions,更加通用,并且能够执行工作流之外的更多操作。然而,这些服务也要求你对每个作业的实现有更多了解。虽然在某些情况下这是必要的,但工作流通过将应用开发者最常用的作业类型预先打包,帮助你快速完成常见任务。此外,工作流旨在为手头的任务提供尽可能最快的云端计算机,并且我们会不断为你更新这些工作流。
🌐 Other CI services, like CircleCI and GitHub Actions, are more generalized and have the ability to do more than workflows. However, those services also require you to understand more about the implementation of each job. While that is necessary in some cases, workflows help you get common tasks done quickly by pre-packaging the most essential types of jobs for app developers. In addition, workflows are designed to provide you with the fastest possible cloud machine for the task at hand, and we're constantly updating those for you.
EAS 工作流程非常适合与你的 Expo 应用相关的操作,而其他 CI/CD 服务则能为其他类型的工作流程提供更好的体验。
🌐 EAS Workflows are great for operations related to your Expo apps, while other CI/CD services will provide a better experience for other types of workflows.
我可以在不使用 GitHub 的情况下触发工作流程吗?
是的。无论 on 触发器的配置如何,任何工作流程都可以使用 eas workflow:run 手动运行。你也可以使用带有 cron 语法的定时触发器。
🌐 Yes. Any workflow can be run manually using eas workflow:run regardless of the on trigger configuration. You can also use scheduled triggers with cron syntax.
工作流运行在哪些云机器上?
工作流在 EAS 管理的基础设施上运行:
🌐 Workflows run on EAS's managed infrastructure:
- Linux 工作节点:
linux-medium(4 核 vCPU,16 GB 内存)或linux-large(8 核 vCPU,32 GB 内存) - 适用于 Android 模拟器的 Linux 嵌套虚拟化:
linux-medium-nested-virtualization或linux-large-nested-virtualization - 用于 iOS 构建和模拟器的 macOS 工作节点:
macos-medium(5 核,20 GB 内存)或macos-large(10 核,40 GB 内存)
工作流能否并行运行任务?
是的。没有依赖的作业默认会并行运行。
🌐 Yes. Jobs without dependencies run in parallel by default.
使用 needs 指定一个作业应等待另一个作业成功,或使用 after 来等待作业完成,无论成功还是失败。
🌐 Use needs to specify that a job should wait for another job to succeed, or after to wait for a job to complete regardless of success or failure.
我可以在工作流中使用环境变量吗?
是的。工作流支持 EAS 环境变量 和内联 env 值。可以使用 ${{ env.VARIABLE_NAME }} 语法引用环境变量。
🌐 Yes. Workflows support EAS environment variables and inline env values. Environment variables can be referenced using ${{ env.VARIABLE_NAME }} syntax.
目前有哪些限制?
没有共享的工作流配置(每个工作流必须独立定义),也没有矩阵构建(无法并行运行具有不同配置的多个变体)。有关更多详细信息和更新,请参见 限制 。
🌐 No shared workflow configurations (each workflow must be defined independently), and no matrix builds (cannot run multiple variations with different configurations in parallel). See Limitations for more details and updates.
我可以在工作流程中运行自定义脚本吗?
是的。使用 steps 的自定义作业让你可以运行 shell 命令,使用内置函数如 eas/checkout 和 eas/install_node_modules,以及为下游作业设置输出。
🌐 Yes. Custom jobs with steps let you run shell commands, use built-in functions like eas/checkout and eas/install_node_modules, and set outputs for downstream jobs.
EAS Workflows 可以与现有的 React Native 项目一起使用吗?
是的。EAS 工作流可以与 CNG(连续原生生成) 以及 现有的 React Native 项目 配合使用,只要项目已配置为 EAS Build。
🌐 Yes. EAS Workflows works with both CNG (Continuous Native Generation) and existing React Native projects, as long as the project is configured for EAS Build.
考虑 EAS 工作流程吗?在下次团队会议上分享以下幻灯片
Share the following slide in your next team meeting to discuss what EAS Workflows are and how they can help your team:

EAS 工作流 CI/CD 同步幻灯片
了解使用 EAS 工作流程自动化你的 CI/CD 流程的好处。
开始使用
🌐 Get started
学习如何创建并运行你的第一个工作流。
使用现成的作业来构建、提交、更新、测试和部署你的应用。
了解用于定义工作流的 YAML 语法。
查看开发构建、预览更新和生产部署的常见工作流程。