This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
自动执行 EAS CLI 命令
了解如何使用 EAS 工作流自动执行一系列 EAS CLI 命令。
如果你使用 EAS CLI 来构建、提交和更新你的应用,你可以使用 EAS 工作流来自动化一系列命令。EAS 工作流可以构建、提交和更新你的应用,同时还可以运行其他任务,如 Maestro 测试、单元测试、自定义脚本等。
🌐 If you're using EAS CLI to build, submit, and update your app, you can automate sequences of commands with EAS Workflows. EAS Workflows can build, submit, and update your app, while also running other jobs like Maestro tests, unit tests, custom scripts, and more.
下面你将了解如何设置项目以使用 EAS 工作流,然后是 EAS CLI 命令的常用示例以及如何使用 EAS 工作流运行它们。
🌐 Below you'll find how to set up your project to use EAS Workflows, followed by common examples of EAS CLI commands and how you can run them using EAS Workflows.
配置你的项目
🌐 Configure your project
EAS 工作流可选择支持与你的 EAS 项目关联的 GitHub 仓库来运行。本指南假设已关联 GitHub 仓库,并演示了如何在推送到 GitHub 上的特定分支时触发工作流。你可以通过以下步骤将 GitHub 仓库关联到你的 EAS 项目:
🌐 EAS Workflows optionally supports a GitHub repository that's linked to your EAS project to run. This guide assumes a GitHub repository is linked, and shows how to trigger workflows when pushing to specific branches on GitHub. You can link a GitHub repo to your EAS project with the following steps:
- 导航到你项目的 GitHub 设置。
- 按照 UI 安装 GitHub 应用。
- 选择与 Expo 项目匹配的 GitHub 存储库并连接它。
创建构建
🌐 Creating builds
你可以使用 EAS CLI 的 eas build 命令来构建你的项目。要使用 production 构建配置生成 iOS 构建,可以运行以下 EAS CLI 命令:
🌐 You can make a build of your project using EAS CLI with the eas build command. To make an iOS build with the production build profile, you could run the following EAS CLI command:
要将此命令写成工作流,请在项目根目录下创建一个名为 .eas/workflows/build-ios-production.yml 的工作流文件。
🌐 To write this command as a workflow, create a workflow file named .eas/workflows/build-ios-production.yml at the root of your project.
在 build-ios-production.yml 中,你可以使用以下工作流程来启动一个使用 production 构建配置生成 iOS 构建的任务。
🌐 Inside build-ios-production.yml, you can use the following workflow to kick off a job that creates an iOS build with the production build profile.
一旦你有了这个工作流文件,你可以通过向 main 分支提交一个 commit 来启动它,或者通过运行以下 EAS CLI 命令来启动:
🌐 Once you have this workflow file, you can kick it off by pushing a commit to the main branch, or by running the following EAS CLI command:
你可以提供参数来进行 Android 构建,或使用其他构建配置文件。通过构建作业文档了解有关构建作业参数的更多信息。
🌐 You can provide parameters to make Android builds or use other build profiles. Learn more about build job parameters with the build job documentation.
提交构建
🌐 Submitting builds
你可以使用 EAS CLI 的 eas submit 命令将你的应用提交到应用商店。要提交 iOS 应用,你可以运行以下 EAS CLI 命令:
🌐 You can submit your app to the app stores using EAS CLI with the eas submit command. To submit an iOS app, you could run the following EAS CLI command:
要将此命令写成工作流,请在项目根目录下创建一个名为 .eas/workflows/submit-ios.yml 的工作流文件。
🌐 To write this command as a workflow, create a workflow file named .eas/workflows/submit-ios.yml at the root of your project.
提交任务需要提供要提交的构建的 ID。在 submit-ios.yml 中,你可以使用以下工作流程来创建 iOS 构建,然后提交它:
🌐 The submit job requires the ID of the build to submit. Inside submit-ios.yml, you can use the following workflow to create an iOS build and then submit it:
要提交一个已有的构建而不是创建新的,只需将它的 build_id 直接传给提交任务,或者使用 get-build 任务动态查找并传递它的 build_id 输出。
🌐 To submit an existing build instead of creating a new one, pass its build_id directly to the submit job, or use the get-build job to look one up dynamically and pass its build_id output.
一旦你有了这个工作流文件,你可以通过向 main 分支提交一个 commit 来启动它,或者通过运行以下 EAS CLI 命令来启动:
🌐 Once you have this workflow file, you can kick it off by pushing a commit to the main branch, or by running the following EAS CLI command:
你可以提供参数来使用其他提交配置文件。通过提交作业文档了解更多关于提交作业参数的信息。
🌐 You can provide parameters to use other submit profiles. Learn more about submit job parameters with the submit job documentation.
发布更新
🌐 Publishing updates
你可以使用 EAS CLI 的 eas update 命令来更新你的应用。要更新你的应用,你可以运行以下 EAS CLI 命令:
🌐 You can update your app using EAS CLI with the eas update command. To update your app, you could run the following EAS CLI command:
要将此命令写成工作流,请在项目根目录下创建一个名为 .eas/workflows/publish-update.yml 的工作流文件。
🌐 To write this command as a workflow, create a workflow file named .eas/workflows/publish-update.yml at the root of your project.
在 publish-update.yml 中,你可以使用以下工作流程来启动一个发送空中更新的任务。
🌐 Inside publish-update.yml, you can use the following workflow to kick off a job that sends and over-the-air update.
获得此工作流文件后,你可以通过向任何分支推送提交或运行以下 EAS CLI 命令来启动它:
🌐 Once you have this workflow file, you can kick it off by pushing a commit to any branch, or by running the following EAS CLI command:
你可以提供参数来更新特定的分支或渠道,并配置更新消息。通过更新作业文档了解有关更新作业参数的更多信息。
🌐 You can provide parameters to update specific branches or channels, and configure the update's message. Learn more about update job parameters with the update job documentation.
下一步
🌐 Next step
工作流是自动化你的开发和发布流程的强大方式。了解如何使用工作流示例指南创建开发版本、发布预览更新以及创建生产版本:
🌐 Workflows are a powerful way to automate your development and release processes. Learn how to create development builds, publish preview updates, and create production builds with the workflows examples guide:
了解如何使用工作流创建开发版本、发布预览更新以及创建生产版本。