Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 38 ยท Projects and Practice

Project: A Release Pipeline

Automate Expo releases: test on every push, preview builds for pull requests, OTA updates for JavaScript fixes, store builds for native changes, with a decision script and CI config.

Shipping by hand works for the first release. By the tenth, you forget a step, publish to the wrong channel or send untested code to users. A release pipeline turns the steps into a machine that runs the same way every time: test, build, publish, submit.

In this project you design a pipeline for an Expo app, write the decision logic ("does this change need a store build or only an OTA update?") as runnable code, and see the CI configuration that runs it. It combines EAS Build, app config, store release, OTA updates and testing.

What runs on this site. The workflows call EAS and GitHub, so they are read-only. The decision logic and the config validator are plain JavaScript and run here.

The pipeline

flowchart TD
  A["Push to branch / pull request"] --> B["Lint + type check + tests"]
  B -->|"pull request"| C["Preview OTA update<br/>(channel: preview)"]
  B -->|"merge to main"| D{"Native change?"}
  D -->|"no"| E["eas update --channel production"]
  D -->|"yes"| F["eas build production + submit<br/>(draft release)"]
  F --> G["Tag release, notify team"]

JavaScript-only changes ship as updates. Native changes ship as store builds.

Principles:

  1. Everything on main must be releasable. Tests and type checks gate every merge.
  2. Test the artifact you ship. Publish to preview, test it, then promote that same update to production.
  3. Secrets live in the CI provider and EAS, never in the repository.
  4. Humans approve store releases. Automation uploads a draft; a person presses release.
  5. Be able to roll back in minutes.

Step 1: quality gate

A pull request workflow with GitHub Actions:

YAML
# .github/workflows/ci.yml
name: CI
on:
  pull_request:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: npm }
      - run: npm ci
      - run: npx expo install --check
      - run: npx expo-doctor
      - run: npx tsc --noEmit
      - run: npm run lint
      - run: npm test -- --ci

The Expo-specific lines catch wrong package versions and project problems before any build is spent.

Step 2: previews for pull requests

YAML
  preview:
    needs: test
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: npm }
      - uses: expo/expo-github-action@v8
        with:
          eas-version: latest
          token: ${{ secrets.EXPO_TOKEN }}
      - run: npm ci
      - run: eas update --channel preview --message "${{ github.event.pull_request.title }}" --non-interactive

Testers with the preview build open the app and receive the pull request's JavaScript. Create the EXPO_TOKEN in your Expo account settings and add it to the repository secrets.

Step 3: decide how to ship

When code lands on main, the question is: can an OTA update deliver this, or is a new binary needed? The EAS fingerprint answers exactly that, because it hashes everything native. Compare the fingerprint of the current store build with the new one:

Terminal
npx @expo/fingerprint . > fingerprint.json     # hash of native inputs

If the hashes match, run eas update. If not, run eas build. You can also approximate with file paths, which is what the stand-in below does.

Node.js Does this change need a store build?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

The path approach is a heuristic: it can be wrong when a dependency's sub-dependency changes. Prefer the fingerprint in the real pipeline, and keep the heuristic as an explanation tool.

Step 4: production workflow

YAML
# .github/workflows/release.yml
name: Release
on:
  push:
    branches: [main]

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - uses: actions/setup-node@v4
        with: { node-version: 22, cache: npm }
      - uses: expo/expo-github-action@v8
        with: { eas-version: latest, token: "${{ secrets.EXPO_TOKEN }}" }
      - run: npm ci
      - run: npm test -- --ci

      - name: Fingerprint check
        id: fp
        run: |
          eas fingerprint:compare --json --non-interactive > fp.json || true
          echo "changed=$(node -e "console.log(require('./fp.json').hasDiff ?? true)")" >> "$GITHUB_OUTPUT"

      - name: OTA update
        if: steps.fp.outputs.changed == 'false'
        run: eas update --channel production --message "${{ github.sha }}" --non-interactive

      - name: Store build
        if: steps.fp.outputs.changed == 'true'
        run: eas build --platform all --profile production --auto-submit --non-interactive

Treat the fingerprint step as a template: command names and output flags change between EAS CLI versions, so check eas --help for your version. The shape of the decision stays the same. Many teams use EAS Workflows (YAML files in .eas/workflows/, run on Expo's servers) for the build and update steps, and keep GitHub Actions for tests.

Step 5: versioning and tags

  • Marketing version in app.json changes only for store releases (semantic versioning).
  • Build numbers come from EAS (autoIncrement).
  • Tag each store release in git (v1.4.0) and write the changelog from pull request titles.
  • Include the update id in your crash reports (debugging lesson) so you can see which release a crash belongs to.
Node.js Bump a semantic version from commit messages

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Step 6: guard the config

A validator that runs in CI stops bad config before it ships. This one checks eas.json for the mistakes this chapter warned about:

Node.js eas.json linter

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Rollback plan

Write it down before you need it:

  1. OTA problem: eas update:rollback or republish the last good update; confirm with crash reports.
  2. Store build problem: halt the staged rollout in the console, ship a fixed build, and use an OTA update to disable the broken feature in the meantime (a remote feature flag makes this much easier).
  3. Server problem: keep old app versions working by versioning your API.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which change generally needs a new store build?

    Native code and permissions live in the binary. JavaScript changes can ship over the air.
  2. 2. Why publish a pull request's update to a preview channel first?

    A preview channel gives a safe place to test the real update.
  3. 3. Where should EXPO_TOKEN be stored?

    Tokens are secrets; keep them in the CI secret store.
  4. 4. Why upload store builds as drafts?

    Humans approve releases; automation prepares them.

Summary

  • A pipeline automates test, preview, build, update and submit, so releases are repeatable.
  • Gate every change with install checks, type checks, lint and tests.
  • Decide between OTA update and store build with the native fingerprint.
  • Keep secrets in CI and EAS, versions in semver with auto-incremented builds, and tag releases.
  • Lint configuration in CI and write the rollback plan before the first incident.

Next: Expo practice questions