Skip to content

Improves workflow:create command#3943

Draft
jonsamp wants to merge 5 commits into
mainfrom
jon/eng-22557-improve-eas-workflowcreate-command
Draft

Improves workflow:create command#3943
jonsamp wants to merge 5 commits into
mainfrom
jon/eng-22557-improve-eas-workflowcreate-command

Conversation

@jonsamp

@jonsamp jonsamp commented Jul 3, 2026

Copy link
Copy Markdown
Member

Why

When running eas workflow:create, the results are not valid and they don't always work. There's more notes in the Linear task. This PR:

  • Adds a --template build|update|deploy|custom flag to select a template non-interactively.
  • eas workflow:create <name> without --template now creates a minimal placeholder workflow
    (name/on/jobs scaffold with doc links) instead of entering the template flow.
  • If the project isn't linked to an EAS project yet, the command runs the same create-or-link flow
    as eas init, letting the user pick the owning account (including organizations) instead of
    silently defaulting to the personal account. The init logic moved from commands/project/init.ts
    to src/project/projectInitialization.ts so both commands share it.
  • The development builds template now sets the project up end to end: creates fixed development
    and development-ios-simulator build profiles in eas.json when missing (replacing the previous
    profile-detection prompts), ensures android.package/ios.bundleIdentifier are defined for
    managed projects, and installs expo-dev-client if it isn't already a dependency.
  • Shorter default file names (build.yml, update.yml, deploy.yml, custom.yml); name
    collisions are resolved with a numeric suffix instead of re-prompting.
  • Tightened the generated template header comments and reworked the post-create output into a
    numbered "Next steps" list with [Action required] items and copy-pasteable commands.
  • Added unit tests covering the templates and howToRunWorkflow.

Examples

Build template

.eas/workflows/build.yml

# Create development builds
#
# Builds Android and iOS development builds for devices and simulators.
# Learn more: https://docs.expo.dev/develop/development-builds/introduction/
#
# Created by EAS CLI v20.5.1

name: Create development builds
jobs:
  android_development_build:
    name: Build Android
    type: build
    params:
      platform: android
      profile: development
  ios_device_development_build:
    name: Build iOS device
    type: build
    params:
      platform: ios
      profile: development
  ios_simulator_development_build:
    name: Build iOS simulator
    type: build
    params:
      platform: ios
      profile: development-ios-simulator

Next steps output

✔ Created .eas/workflows/build.yml

➡️ Next steps:

1.  [Action required] Set up iOS credentials so the development build can run on a physical device (you'll register your device when prompted). Learn more: https://docs.expo.dev/app-signing/app-credentials/ Run eas credentials:configure-build -p ios -e development
2.  Run this workflow with eas workflow:run build.yml
Update template

.eas/workflows/update.yml

# Publish update
#
# Publishes an EAS Update to the current branch.
# Learn more: https://docs.expo.dev/eas/workflows/examples/publish-preview-update/
#
# Created by EAS CLI v20.5.1

name: Publish update
jobs:
  publish_update:
    name: Publish update
    type: update
    params:
      branch: ${{ github.ref_name || "main" }}

Next steps output

✔ Created .eas/workflows/update.yml

➡️ Next steps:

1.  Run this workflow with eas workflow:run update.yml
Deploy template

.eas/workflows/deploy.yml

# Deploy to production
#
# Builds and submits to the app stores, or sends an over-the-air update when there are no native changes.
# Learn more: https://docs.expo.dev/eas/workflows/examples/deploy-to-production/
#
# Created by EAS CLI v20.5.1

name: Deploy to production
jobs:
  fingerprint:
    name: Fingerprint
    type: fingerprint
  get_android_build:
    name: Check for existing android build
    needs:
      - fingerprint
    type: get-build
    params:
      fingerprint_hash: ${{ needs.fingerprint.outputs.android_fingerprint_hash }}
      profile: production
  get_ios_build:
    name: Check for existing ios build
    needs:
      - fingerprint
    type: get-build
    params:
      fingerprint_hash: ${{ needs.fingerprint.outputs.ios_fingerprint_hash }}
      profile: production
  build_android:
    name: Build Android
    needs:
      - get_android_build
    if: ${{ !needs.get_android_build.outputs.build_id }}
    type: build
    params:
      platform: android
      profile: production
  build_ios:
    name: Build iOS
    needs:
      - get_ios_build
    if: ${{ !needs.get_ios_build.outputs.build_id }}
    type: build
    params:
      platform: ios
      profile: production
  submit_android_build:
    name: Submit Android Build
    needs:
      - build_android
    type: submit
    params:
      build_id: ${{ needs.build_android.outputs.build_id }}
  submit_ios_build:
    name: Submit iOS Build
    needs:
      - build_ios
    type: submit
    params:
      build_id: ${{ needs.build_ios.outputs.build_id }}
  publish_android_update:
    name: Publish Android update
    needs:
      - get_android_build
    if: ${{ needs.get_android_build.outputs.build_id }}
    type: update
    params:
      branch: production
      platform: android
  publish_ios_update:
    name: Publish iOS update
    needs:
      - get_ios_build
    if: ${{ needs.get_ios_build.outputs.build_id }}
    type: update
    params:
      branch: production
      platform: ios

Next steps output

✔ Created .eas/workflows/deploy.yml

➡️ Next steps:

1.  [Action required] Set up iOS build credentials for the "production" profile, required by the build jobs. Run eas credentials:configure-build -p ios -e production
2.  [Action required] Set up Android build credentials for the "production" profile, required by the build jobs. Run eas credentials:configure-build -p android -e production
3.  [Action required] Set up an App Store Connect API Key, required by the iOS submit job. In the menu, choose "App Store Connect: Manage your API Key" then "Set up your project to use an API Key for EAS Submit". Run eas credentials -p ios
4.  [Action required] Set up a Google Service Account Key, required by the Android submit job. In the menu, choose "Google Service Account" then "Set up a Google Service Account Key for Play Store Submissions". Run eas credentials -p android
5.  Run this workflow with eas workflow:run deploy.yml
Custom template

.eas/workflows/custom.yml

# Custom workflow
#
# Runs eas/checkout, then a custom shell command. Triggered on pushes to "main".
# Learn more: https://docs.expo.dev/eas/workflows/syntax/
#
# Created by EAS CLI v20.5.1

name: Custom workflow
on:
  push:
    branches:
      - main
jobs:
  custom_build:
    name: Custom job
    steps:
      - uses: eas/checkout
      - name: Hello World
        id: hello_world
        run: |
          # Custom script
          echo "Hello, World"

Next steps output

✔ Created .eas/workflows/custom.yml

➡️ Next steps:

1.  This workflow also runs automatically when code is pushed to the "main" branch. Run this workflow with eas workflow:run custom.yml
Placeholder (file name without --template)

.eas/workflows/my-workflow.yml

name: # Workflow name

on: # Add triggers https://docs.expo.dev/eas/workflows/syntax/#on

jobs: # Add pre-packaged jobs https://docs.expo.dev/eas/workflows/pre-packaged-jobs/. See all syntax https://docs.expo.dev/eas/workflows/syntax/#jobs.

Next steps output

✔ Created .eas/workflows/my-workflow.yml

➡️ Next steps:

1.  Fill in the "name", "on", and "jobs" fields. Learn more: https://docs.expo.dev/eas/workflows/syntax/
2.  Run this workflow with eas workflow:run my-workflow.yml

Test plan

  • Manually run eas workflow:create in a test project: with --template for each template, with a
    bare file name (placeholder path), interactively with no args, and in an unlinked project to
    verify the account-selection flow.

@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown

ENG-22557

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 49.86150% with 181 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.42%. Comparing base (72ca5c2) to head (ac1b0c0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/workflow/create.ts 5.48% 69 Missing ⚠️
...kages/eas-cli/src/project/projectInitialization.ts 74.46% 45 Missing and 2 partials ⚠️
...ages/eas-cli/src/commandUtils/workflow/creation.ts 29.17% 34 Missing ⚠️
...cli/src/commandUtils/workflow/buildProfileUtils.ts 28.13% 23 Missing ⚠️
...kages/eas-cli/src/project/android/applicationId.ts 60.00% 4 Missing ⚠️
...ckages/eas-cli/src/project/ios/bundleIdentifier.ts 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3943      +/-   ##
==========================================
+ Coverage   59.24%   59.42%   +0.19%     
==========================================
  Files         935      936       +1     
  Lines       41061    41020      -41     
  Branches     8650     8637      -13     
==========================================
+ Hits        24323    24374      +51     
+ Misses      16644    16552      -92     
  Partials       94       94              

☔ View full report in Codecov by Harness.
📢 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.

@github-actions

github-actions Bot commented Jul 3, 2026

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.

1 participant