Skip to content

[build-tools] Add eas/deploy function#3598

Draft
gwdp wants to merge 7 commits intomainfrom
gwdp/deploy-function-group
Draft

[build-tools] Add eas/deploy function#3598
gwdp wants to merge 7 commits intomainfrom
gwdp/deploy-function-group

Conversation

@gwdp
Copy link
Copy Markdown
Contributor

@gwdp gwdp commented Apr 9, 2026

Why

Introduce eas/deploy function to streamline export+deploy usual combination within single unit. Includes deploy_json output from eas deploy --json for anything that comes after.

Ref ENG-14737

How

New function with configurable export command, deploy alias, prod and source_maps; environment is passed through when it’s on job metadata.

Test Plan

Local run with the following workflows

✅ Success path

name: deploy-web-custom

on:
  workflow_dispatch: {}
  push:
    branches: ["main"]

jobs:
  deploy_custom:
    name: Deploy web with custom steps
    type: custom
    runs_on: linux-medium
    environment: production
    outputs:
      deploy_json: ${{ steps.deploy.outputs.deploy_json }}
    env:
      APP_VARIANT: production
    steps:
      - uses: eas/checkout
      - uses: eas/use_npm_token
      - uses: eas/install_node_modules
      - uses: eas/deploy
        id: deploy
        with:
          environment: production
          source_maps: false
          export_command: npx expo export --platform web --clear && echo "Custom export command done"
      - run: echo "Deploy output - ${{ steps.deploy.outputs.deploy_json }}"

  read_output:
    name: Read deploy output from another job
    type: custom
    runs_on: linux-medium
    needs: [deploy_custom]
    steps:
      - run: echo "Deploy JSON from previous job - ${{ needs.deploy_custom.outputs.deploy_json }}"

Screenshot 2026-04-10 at 4 34 43 PM Screenshot 2026-04-10 at 4 34 48 PM

❌ Failure pattern

name: deploy-web-custom-simple-no-setup

on:
  workflow_dispatch: {}

jobs:
  deploy_custom:
    name: Deploy web without setup steps (expected to fail)
    type: custom
    runs_on: linux-medium
    environment: production
    env:
      APP_VARIANT: production
    steps:
      - run: echo "Before eas/deploy - no npm token, or node_modules"
      - uses: eas/checkout
      - uses: eas/deploy
      - run: echo "After eas/deploy stub"


Screenshot 2026-04-10 at 4 29 54 PM

@gwdp gwdp self-assigned this Apr 9, 2026
@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 97.32143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.00%. Comparing base (3a70a5d) to head (f3bbb02).

Files with missing lines Patch % Lines
...ackages/build-tools/src/common/easBuildInternal.ts 50.00% 2 Missing ⚠️
packages/build-tools/src/utils/easCli.ts 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3598      +/-   ##
==========================================
+ Coverage   54.86%   55.00%   +0.15%     
==========================================
  Files         836      839       +3     
  Lines       35901    36000      +99     
  Branches     7492     7509      +17     
==========================================
+ Hits        19694    19800     +106     
+ Misses      16112    16105       -7     
  Partials       95       95              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp gwdp force-pushed the gwdp/deploy-function-group branch 3 times, most recently from 5c6fd4a to 69a1359 Compare April 10, 2026 22:45
@gwdp gwdp changed the title [build-tools] Add eas/deploy function group [build-tools] Add eas/deploy function Apr 10, 2026
@gwdp gwdp force-pushed the gwdp/deploy-function-group branch from 69a1359 to ab71dbc Compare April 10, 2026 23:53
@gwdp gwdp requested a review from sjchmiela April 10, 2026 23:55
@gwdp gwdp marked this pull request as ready for review April 11, 2026 00:12
@github-actions
Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

Comment on lines +34 to +39
BuildStepInput.createProvider({
id: 'export_command',
allowedValueTypeName: BuildStepInputValueTypeName.STRING,
required: false,
defaultValue: 'npx expo export --platform web',
}),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about making it be a separate function? then the input to this function would be the export_dir and output of eas/[expo_]export would be the dist_dir?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, allows a little more space for inputs from the export side. Let me know if you have any additional thoughts around the inputs of export function.

Around the name, not 100% sure if you suggested eas/expo_export, would that be the case? I can see prebuild which similarly, calls expo command, not having the prefix although it would make sense imo. export only could be too broad for people new to EAS, as me?

});
outputs.deploy_json.set(result.stdout.toString());
} catch (error) {
throw new UserError(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if it would be nice if we made eas-cli deploy return different exit codes for different issues and based on that figure out whether it was a system or user error?

I have https://exponent-internal.slack.com/archives/C06EFBQK3B7/p1773417343042269 in my memory

gwdp and others added 4 commits April 13, 2026 13:45
@gwdp gwdp marked this pull request as draft April 13, 2026 21:34
…rkflows

- Add eas/export: expo export via runExpoCliCommand and getExportCommand, structured inputs, export_dir output.
- Refine eas/deploy: build argv with getDeployCommand, parse deploy JSON with parseDeploymentOutput, expanded tests.
- Register eas/export in getEasFunctions; update CHANGELOG for both steps.
@gwdp gwdp force-pushed the gwdp/deploy-function-group branch from 2ed7556 to 318e764 Compare April 13, 2026 22:17
gwdp added 2 commits April 13, 2026 15:55
Probe easd --help when ENVIRONMENT is development; use easd if it
succeeds, otherwise log and fall back to npx eas-cli@staging. Log
when easd is used. Pass logger from easBuildInternal into resolver
so messages appear in build logs.
Probe easd --help in development; on success log a warn and use easd.
Fall back to npx eas-cli@staging without an info line. Pass logger from
easBuildInternal and runEasCliCommand so the warn appears in logs.
@gwdp gwdp force-pushed the gwdp/deploy-function-group branch from 101e6f1 to f3bbb02 Compare April 13, 2026 23:12
@github-actions
Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants