eas-workflows

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

EAS Workflows Skill

EAS工作流技能

EAS service - costs apply. EAS Workflows run on Expo Application Services, a paid product with free-tier limits. Each workflow job consumes your plan's build/compute minutes, and jobs that build or submit also need paid Apple Developer and Google Play accounts. Review https://expo.dev/pricing before triggering runs.
Help developers write and edit EAS CI/CD workflow YAML files.
EAS服务 - 需付费使用。EAS工作流运行于Expo Application Services(一款带有免费额度限制的付费产品)之上。每个工作流任务会消耗您套餐内的构建/计算时长,而涉及构建或提交的任务还需要付费的Apple Developer和Google Play账号。触发任务前,请查看https://expo.dev/pricing了解详情。
帮助开发者编写和编辑EAS CI/CD工作流YAML文件。

Reference Documentation

参考文档

Fetch these resources before generating or validating workflow files. First resolve this skill's directory, then use the fetch script in its
scripts/
directory. It is implemented using Node.js and caches responses using ETags for efficiency:
bash
undefined
在生成或验证工作流文件前,请获取以下资源。首先定位此技能的目录,然后使用其
scripts/
目录下的获取脚本。该脚本基于Node.js实现,并利用ETags缓存响应以提升效率:
bash
undefined

Fetch resources

获取资源

node <skill-dir>/scripts/fetch.js <url>

1. **JSON Schema** — https://api.expo.dev/v2/workflows/schema
   - It is NECESSARY to fetch this schema
   - Source of truth for validation
   - All job types and their required/optional parameters
   - Trigger types and configurations
   - Runner types, VM images, and all enums

2. **Syntax Documentation** — https://raw.githubusercontent.com/expo/expo/refs/heads/main/docs/pages/eas/workflows/syntax.mdx
   - Overview of workflow YAML syntax
   - Examples and English explanations
   - Expression syntax and contexts

3. **Pre-packaged Jobs** — https://raw.githubusercontent.com/expo/expo/refs/heads/main/docs/pages/eas/workflows/pre-packaged-jobs.mdx
   - Documentation for supported pre-packaged job types
   - Job-specific parameters and outputs

Do not rely on memorized values; these resources evolve as new features are added.
node <skill-dir>/scripts/fetch.js <url>

1. **JSON Schema** — https://api.expo.dev/v2/workflows/schema
   - 必须获取此Schema
   - 验证的权威依据
   - 包含所有任务类型及其必填/可选参数
   - 触发类型及配置
   - 运行器类型、VM镜像及所有枚举值

2. **语法文档** — https://raw.githubusercontent.com/expo/expo/refs/heads/main/docs/pages/eas/workflows/syntax.mdx
   - 工作流YAML语法概述
   - 示例及英文说明
   - 表达式语法及上下文

3. **预封装任务** — https://raw.githubusercontent.com/expo/expo/refs/heads/main/docs/pages/eas/workflows/pre-packaged-jobs.mdx
   - 受支持的预封装任务类型文档
   - 任务专属参数及输出

请勿依赖记忆中的值;这些资源会随着新功能的添加而不断更新。

Workflow File Location

工作流文件位置

Workflows live in
.eas/workflows/*.yml
(or
.yaml
).
工作流文件存放于
.eas/workflows/*.yml
(或
.yaml
)目录下。

Top-Level Structure

顶层结构

A workflow file has these top-level keys:
  • name
    — Display name for the workflow
  • on
    — Triggers that start the workflow (at least one required)
  • jobs
    — Job definitions (required)
  • defaults
    — Shared defaults for all jobs
  • concurrency
    — Control parallel workflow runs
Consult the schema for the full specification of each section.
工作流文件包含以下顶层键:
  • name
    — 工作流的显示名称
  • on
    — 触发工作流启动的条件(至少需配置一个)
  • jobs
    — 任务定义(必填)
  • defaults
    — 所有任务共享的默认配置
  • concurrency
    — 控制工作流的并行运行
每个部分的完整规范请参考Schema。

Expressions

表达式

Use
${{ }}
syntax for dynamic values. The schema defines available contexts:
  • github.*
    — GitHub repository and event information
  • inputs.*
    — Values from
    workflow_dispatch
    inputs
  • needs.*
    — Outputs and status from dependent jobs
  • jobs.*
    — Job outputs (alternative syntax)
  • steps.*
    — Step outputs within custom jobs
  • workflow.*
    — Workflow metadata
使用
${{ }}
语法表示动态值。Schema定义了可用的上下文:
  • github.*
    — GitHub仓库及事件信息
  • inputs.*
    workflow_dispatch
    输入的值
  • needs.*
    — 依赖任务的输出及状态
  • jobs.*
    — 任务输出(替代语法)
  • steps.*
    — 自定义任务内的步骤输出
  • workflow.*
    — 工作流元数据

Generating Workflows

生成工作流

When generating or editing workflows:
  1. Fetch the schema to get current job types, parameters, and allowed values
  2. Validate that required fields are present for each job type
  3. Verify job references in
    needs
    and
    after
    exist in the workflow
  4. Check that expressions reference valid contexts and outputs
  5. Ensure
    if
    conditions respect the schema's length constraints
生成或编辑工作流时:
  1. 获取Schema以获取当前的任务类型、参数及允许的值
  2. 验证每个任务类型的必填字段是否存在
  3. 确认
    needs
    after
    中引用的任务在工作流中存在
  4. 检查表达式是否引用了有效的上下文和输出
  5. 确保
    if
    条件符合Schema的长度限制

Validation

验证

After generating or editing a workflow file, validate it against the schema:
sh
undefined
生成或编辑工作流文件后,请根据Schema进行验证:
sh
undefined

Install dependencies if missing

若缺少依赖则安装

[ -d "<skill-dir>/scripts/node_modules" ] || npm install --prefix <skill-dir>/scripts
node <skill-dir>/scripts/validate.js <workflow.yml> [workflow2.yml ...]

The validator fetches the latest schema and checks the YAML structure. Fix any reported errors before considering the workflow complete.
[ -d "<skill-dir>/scripts/node_modules" ] || npm install --prefix <skill-dir>/scripts
node <skill-dir>/scripts/validate.js <workflow.yml> [workflow2.yml ...]

验证器会获取最新的Schema并检查YAML结构。在确认工作流完成前,请修复所有报告的错误。

Answering Questions

答疑要点

When users ask about available options (job types, triggers, runner types, etc.), fetch the schema and derive the answer from it rather than relying on potentially outdated information.
当用户询问可用选项(如任务类型、触发方式、运行器类型等)时,请获取Schema并从中推导答案,而非依赖可能过时的信息。