expo-cicd-workflows

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

EAS Workflows Skill

EAS工作流技能

Help developers write and edit EAS CI/CD workflow YAML files.
帮助开发者编写和编辑EAS CI/CD工作流YAML文件。

Reference Documentation

参考文档

Fetch these resources before generating or validating workflow files. Use the fetch script (implemented using Node.js) in this skill's
scripts/
directory; it caches responses using ETags for efficiency:
bash
undefined
在生成或验证工作流文件之前,请获取以下资源。使用此技能
scripts/
目录中的获取脚本(基于Node.js实现);它会使用ETags缓存响应以提升效率:
bash
undefined

Fetch resources

获取资源

node {baseDir}/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 {baseDir}/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 "{baseDir}/scripts/node_modules" ] || npm install --prefix {baseDir}/scripts
node {baseDir}/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 "{baseDir}/scripts/node_modules" ] || npm install --prefix {baseDir}/scripts
node {baseDir}/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并从中推导答案,而非依赖可能过时的信息。