expo-cicd-workflows
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEAS 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 directory; it caches responses using ETags for efficiency:
scripts/bash
undefined在生成或验证工作流文件之前,请获取以下资源。使用此技能目录中的获取脚本(基于Node.js实现);它会使用ETags缓存响应以提升效率:
scripts/bash
undefinedFetch 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 (or ).
.eas/workflows/*.yml.yaml工作流文件存放在(或)目录下。
.eas/workflows/*.yml.yamlTop-Level Structure
顶层结构
A workflow file has these top-level keys:
- — Display name for the workflow
name - — Triggers that start the workflow (at least one required)
on - — Job definitions (required)
jobs - — Shared defaults for all jobs
defaults - — Control parallel workflow runs
concurrency
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 repository and event information
github.* - — Values from
inputs.*inputsworkflow_dispatch - — Outputs and status from dependent jobs
needs.* - — Job outputs (alternative syntax)
jobs.* - — Step outputs within custom jobs
steps.* - — Workflow metadata
workflow.*
使用语法表示动态值。Schema定义了可用的上下文:
${{ }}- — GitHub仓库和事件信息
github.* - — 来自
inputs.*的输入值workflow_dispatch - — 依赖任务的输出和状态
needs.* - — 任务输出(替代语法)
jobs.* - — 自定义任务中的步骤输出
steps.* - — 工作流元数据
workflow.*
Generating Workflows
生成工作流
When generating or editing workflows:
- Fetch the schema to get current job types, parameters, and allowed values
- Validate that required fields are present for each job type
- Verify job references in and
needsexist in the workflowafter - Check that expressions reference valid contexts and outputs
- Ensure conditions respect the schema's length constraints
if
生成或编辑工作流时:
- 获取Schema以获取当前的任务类型、参数和允许的值
- 验证每个任务类型的必填字段是否存在
- 验证和
needs中引用的任务是否存在于工作流中after - 检查表达式是否引用了有效的上下文和输出
- 确保条件符合Schema的长度限制
if
Validation
验证
After generating or editing a workflow file, validate it against the schema:
sh
undefined在生成或编辑工作流文件后,根据Schema对其进行验证:
sh
undefinedInstall 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并从中推导答案,而非依赖可能过时的信息。