OpenAIExpoFeb 12, 2026, 4:45 PM

Automate mobile CI/CD with EAS Workflows and custom builds

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Automate mobile CI/CD with EAS Workflows and custom builds

Key Points

  • Single YAML pipelines for builds, tests, submissions, and updates
  • Pre-packaged job types (submit, maestro, slack, update, etc.)
  • Custom build jobs in .eas/build with bash or JS functions

Summary

EAS Workflows is Expo's unified CI/CD orchestration that consolidates builds, tests, submissions, updates, and notifications into YAML-defined pipelines. Define pipelines in .eas/workflows/.yml and custom build jobs in .eas/build/.yml. Workflows support push/pull_request triggers, schedules, manual runs (eas workflow:run), path filtering and label-based triggers, and can be combined with existing CI systems.

Key Points

  • Define full pipelines in .eas/workflows/.yml; custom build job configs live in .eas/build/.yml.
  • Triggers: push, pull_request, schedule (cron), manual runs; also path-filtering and pull_request_labeled.
  • Pre-packaged job types (no custom code needed): submit, testflight, update, deploy, maestro, fingerprint, get-build, repack, slack, github-comment, require-approval, doc.
  • Use eas/build as a single-step build or replace it with underlying steps for deeper control (unlock secrets, change env, dynamic deps).
  • Add run (bash) steps for simple integrations (Discord, curl, Fastlane) or use custom JS/TypeScript functions for typed access, reuse, and maintainability.
  • Orchestrate dependent jobs with needs (only-on-success) and after (always run) to build pipelines that run build -> submit -> notifications.
  • Migration: legacy custom builds continue to work; call eas workflow:run from other CI to delegate mobile-specific tasks to EAS.

Practical examples

YAML trigger and simple pipeline example:

on:
  push:
    branches: ["main"]
  schedule:
    - cron: '0 2 * * 1-5'

jobs:
  build:
    type: build
    params:
      platform: ios
      profile: production
  submit:
    type: submit
    needs: [build]

Custom build snippet using a run step (Discord webhook):

build:
  steps:
    - eas/build
    - run:
        command: |
          curl -H 'Content-Type: application/json' \
            -d '{"content":"New build succeeded! URL: ${eas.job.expoBuildUrl}"}' \
            https://discord.com/api/webhooks/...

Next steps

  • Use pre-packaged jobs for common tasks; implement JS functions for repeatable logic.
  • Migrate triggers to EAS Workflows and invoke from existing CI with eas workflow:run to centralize mobile automation.
  • See docs for full syntax, pre-packaged job reference, and TypeScript functions guide.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

EAS Workflows とカスタムビルドでモバイルのCI/CDを自動化する

概要

EAS Workflows は、ビルド、テスト、アップデート、サブミッション、通知などを単一の YAML ファイルで自動化できる Expo の CI/CD オーケストレーションシステムです。従来は eas.json の制約によりビルド処理のカスタマイズは限られており、ステップのスキップや置換、ビルド前後の高度なオーケストレーションは扱いにくいものでした。2023 年にプレビュー公開された「完全カスタマイズ可能なビルド」機能を経て、現在はこれらの機能が EAS Workflows に統合されています。

Expo は GitHub ビルドトリガーを非推奨にし、より柔軟で強力なオーケストレーションを提供する EAS Workflows を推奨しています。カスタムビルドジョブの設定は .eas/build に、Workflows の設定は .eas/workflows に置き、ジョブ(ビルドジョブを含む)をパイプラインとして定義します。

モバイル CI/CD パイプラインのオーケストレーション

EAS Workflows では YAML で定義したパイプラインにより、ビルド、テスト、ストア提出、OTA アップデート、通知などを自動化できます。Workflows はパイプラインの実行タイミングとジョブ間の依存関係を定義し、ビルドジョブ(カスタムビルドジョブ含む)をそのコンポーネントとして動かします。

Workflows は .eas/workflows/*.yml に定義し、以下のようなトリガーをサポートします:push、pull_request、スケジュール、手動実行。パスフィルタリングやラベルベーストリガー(pull_request_labeled)も利用可能です。

on: push: branches: [ 'main' ] pull_request: branches: [ 'main' ] schedule: cron: '0 2 * * 1-5' # 平日の 2 AM UTC

任意のワークフローは eas workflow:run で手動実行できます(on: の設定に関係なく)。

カスタマイズ可能なビルドのユースケース

ユーザーからのニーズを踏まえ、ビルドパイプライン内で実行したい具体的なステップをそのまま Workflows に組み込めます。例:

  • ビルド完了後に Slack でチームに通知して新しいビルドのダウンロードを促す(example、docs)
  • Maestro を使ったエンドツーエンドテストを実行する(example、docs)
  • 単一パイプライン内で複数ターゲット向けのアーカイブを作成する(例:Android の本番 .aab とテスト用のプレビュー)
  • ビルド成功後に自動で TestFlight / Google Play に提出する(Android example、iOS example)
  • 成功検証後に OTA アップデートを公開する

これらのビルドジョブや自動化ステップは EAS Workflows のオーケストレーションで組み合わせて完全なパイプラインにできます。

標準で利用できるプレパッケージジョブ

EAS Workflows には一般的なモバイル CI/CD タスク用のプレパッケージジョブが用意されており、カスタム設定なしで YAML にジョブタイプを宣言するだけで使えます:

  • submit — App Store / Google Play へ提出
  • testflight — TestFlight グループへ配布(changelogs とベータ審査コントロール付き)
  • update — EAS Update 経由で OTA 更新を公開
  • deploy — EAS Hosting で Web アプリをデプロイ
  • maestro / maestro-cloud — エミュレータ / シミュレータ上で Maestro E2E テストを実行
  • fingerprint — プロジェクトのネイティブ特性をハッシュ化してフルビルドが必要か検出
  • get-build — fingerprint に合う既存ビルドを検索し冗長なビルドを回避
  • repack — 既存ビルドに JS を再パッケージして完全なネイティブビルドを省略(約2分)
  • slack — Webhook 経由で Slack 通知を送信
  • github-comment — プルリクにビルドリンクや QR コードを自動投稿
  • require-approval — 本番デプロイを手動承認でガード
  • doc — ワークフローログに Markdown のメモを表示

フルシンタックスと例は pre-packaged jobs ドキュメントを参照してください。

ビルドのカスタマイズ方法

初期設定

ビルドプロファイル設定で、カスタムビルドジョブの設定ファイル(.eas/build 配下)を指定できます。これらのカスタムビルドジョブは単独で実行することも、EAS Workflows のパイプラインの一部としてオーケストレーションすることもできます。例:

{
  "build": {
    "production": {
      // Builds with profile "production"
      // will use .eas/build/production.yml file
      "config": "production.yml"
    },
    "development": {
      "android": {
        // uses .eas/build/development-android.yml
        "config": "development-android.yml"
      },
      "ios": {
        // uses .eas/build/development-ios.yml
        "config": "development-ios.yml"
      }
    }
  }
}

基本的なカスタムビルドワークフロー

もっともシンプルな Custom Builds ワークフローは次のようになります:

build:
  steps:
    - eas/build

eas/build 関数は、設定されたビルドプロファイルを使ってアプリをビルドします。このステップはテスト、提出、デプロイ等の他のジョブとともに大きな EAS Workflows パイプラインの一部としてオーケストレーションできます。

Bash ステップ

ビルド成功後に Discord にメッセージを送るなど、サービスに組み込みサポートがない場合は run ステップで Bash スクリプトを実行できます。Slack 用には組み込みの slack ジョブタイプがあるためスクリプトは不要です。

まず Discord の webhook を用意してください(Discord webhook のチュートリアル参照)。以下は run ステップの例です:

build:
  steps:
    - eas/build
    - run:
        command: |
          # Post a new message to Discord
          # https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
          curl \
            -H 'Content-Type: application/json' \
            -d '{"content": "New build succeeded! URL: ${ eas.job.expoBuildUrl }"}' \
            https://discord.com/api/webhooks/... # your webhook URL here

run のコマンドは Bash スクリプトとして実行されます。curl、Fastlane、Node.js スクリプトやその他のカスタム自動化ロジックを利用可能です。

カスタム JavaScript 関数

簡易タスクには Bash が便利ですが、高度な処理には JavaScript(TypeScript)関数を推奨します。利点:

  • ビルドプロパティへの型付きアクセス
  • ワークフロー間での再利用性向上
  • 保守性の向上

カスタム関数はカスタムビルドジョブと EAS Workflows 両方に統合できます。セットアップ方法は EAS Build ドキュメントの「TypeScript functions」ガイドを参照してください。

eas/build の深いカスタマイズ

eas/build をその基底ステップに置き換えることで、より深いカスタマイズが可能になります。例:

  • 暗号化されたシークレットのアンロック
  • ビルド環境の変更
  • 依存関係の動的インストール
  • ビルド前の検証スクリプト実行

プラットフォーム(Android/iOS)と資格情報の有無に応じて、次の 4 種類のスキャフォールドが用意されています:

  • Android with credentials(署名済み AAB をビルド)
  • Android without credentials(エミュレータ用 APK をビルド)
  • iOS with credentials(配布可能 IPA をビルド)
  • iOS without credentials(Simulator APP をビルド)

コピー後に必要な修正を加えてください。例えば git-crypt で暗号化されたファイルをアンロックするには、GIT_CRYPT_KEY を base64 エンコードして EAS プロジェクトのシークレットとして追加します。クリップボードへコピーするためのコマンドはアンロック済み環境で実行してください。また、プロジェクトが Full Git Workflow 用に設定されている(cli.requireCommittrue に設定された eas.json)ことを確認してから、eas/checkout ステップの後に Bash スクリプトを追加します。

EAS Workflows 内でのカスタムビルドジョブの利用

EAS Workflows を使えば、ビルドジョブをコンポーネントとして組み合わせ、完全なパイプラインをオーケストレーションできます。例:

name: Build and Submit
on:
  push:
    branches: [ main ]
jobs:
  build:
    type: build
    params:
      platform: ios
      profile: production
  submit:
    type: submit
    needs: [ build ] # build が成功した場合のみ実行
    params:
      build_id: ${{ needs.build.outputs.build_id }}
  notify:
    type: slack
    after: [ build, submit ] # 成功・失敗に関わらず実行(通知やクリーンナップ向け)
    params:
      webhook_url: https://hooks.slack.com/services/ ...
      message: 'Pipeline finished for ${{ needs.build.outputs.app_version }}'

needs は依存先が成功した場合にのみジョブを実行します。after は依存先の成否に関わらず実行されるため、通知やクリーンナップに便利です。

既存のビルドオーケストレーションからの移行

既存のカスタムビルド設定は引き続き動作し、Workflows パイプラインに直接統合できます。GitHub Actions や他の CI を使い続けたいチームも、既存のパイプラインから eas workflow:run を呼び出して Workflows にモバイル固有のジョブ(iOS ビルド、コード署名、ストア提出など)を任せつつ、現在の CI で lint、ユニットテスト、コードレビューを継続することができます。

今後の展望と次のステップ

ビルドは高品質なモバイルアプリを届けるための一歩に過ぎません。EAS Workflows はビルド、テスト、提出、アップデートを単一プラットフォームで自動化する完全な CI/CD オーケストレーションを提供します。カスタムビルドジョブはこれらのパイプライン内で深いカスタマイズを可能にし、我々は引き続き新しいジョブタイプ、改善された自動化機能、より深い統合を拡張していきます。

ぜひフィードバックをお寄せください。次に試すと良いステップ:

  • Deploy to Production workflow — fingerprint 検出からストア提出までのフルパイプライン
  • E2E testing with Maestro — PR ごとにテストを実行
  • Pre-packaged jobs reference — すべてのジョブタイプのフルシンタックス
  • Workflows syntax — YAML の完全仕様