new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Expo · EAS · all subjects

build-reference details

35 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

eas/build built-in function

The eas/build is an all-in-one function that encapsulates the entire EAS Build build process. It resolves the best build configuration based on your build profile's settings from eas.json. It is ideal for people who want to have the build done without worrying about altering and configuring the build process manually.

eas/build function limitation - no inputs

The eas/build function doesn't accept any inputs, and the resolved build process will be configured based on your build profile from eas.json.

eas/build function limitation - not customizable

The build process produced by eas/build is not configurable and you can't customize it. If you need to customize the build process, use the subset of functions and steps that are executed behind the scenes by this function and configure them manually in the YAML configuration file.

eas/build Android with withoutCredentials workflow

When a build configuration is using withoutCredentials for Android, the eas/build function executes these steps in order: eas/checkout, eas/use_npm_token, eas/install_node_modules, eas/resolve_build_config, eas/prebuild, eas/configure_eas_update, eas/run_gradle, eas/find_and_upload_build_artifacts.

eas/build Android with credentials workflow

When a build configuration uses credentials for both internal and store distribution builds on Android, the eas/build function executes these steps in order: eas/checkout, eas/use_npm_token, eas/install_node_modules, eas/resolve_build_config, eas/prebuild, eas/configure_eas_update, eas/inject_android_credentials, eas/configure_android_version, eas/run_gradle, eas/find_and_upload_build_artifacts.

eas/build iOS with withoutCredentials or simulator workflow

When a build configuration is using withoutCredentials or simulator for iOS, the eas/build function executes these steps in order: eas/checkout, eas/use_npm_token, eas/install_node_modules, eas/resolve_build_config, eas/prebuild, pod install, eas/configure_eas_update, eas/generate_gymfile_from_template, eas/run_fastlane, eas/find_and_upload_build_artifacts.

eas/build iOS with credentials workflow

When a build configuration uses credentials for both internal and store distribution builds on iOS, the eas/build function executes these steps in order: eas/checkout, eas/use_npm_token, eas/install_node_modules, eas/resolve_build_config, eas/resolve_apple_team_id_from_credentials, eas/prebuild, pod install, eas/configure_eas_update, eas/configure_ios_credentials, eas/configure_ios_version, eas/generate_gymfile_from_template, eas/run_fastlane, eas/find_and_upload_build_artifacts.

eas/checkout built-in function

The eas/checkout function checks out your project source files. For builds with Git-based project sources, the step uses the build's recorded commit by default.

eas/checkout ref limitation

The ref input in eas/checkout only works when your project sources come from a Git repository, for example, a build triggered through the GitHub integration. Local builds and uploaded project tarballs do not support it.

eas/restore_build_cache function inputs and properties

The eas/restore_build_cache function restores a previously saved build cache from a specified key. It has the following inputs and properties: name (optional, string, defaults to 'Restore build cache'), inputs.key (required, string, the cache key to restore, supports expressions like ${{ hashFiles('package-lock.json') }}), inputs.restore_keys (optional, string, a fallback key or prefix to use if the exact key is not found), inputs.path (required, string, the path where the cache should be restored).

eas/save_build_cache function inputs and properties

The eas/save_build_cache function saves a build cache to a specified key. It has the following inputs and properties: name (optional, defaults to 'Save build cache'), inputs.key (required, string, the cache key to save under, supports expressions like ${{ hashFiles('package-lock.json') }}), inputs.path (required, string, the path to the directory or files that should be cached).

eas/resolve_build_config function

The eas/resolve_build_config function resolves and prints the build configuration. If the build has been triggered by the GitHub integration, it will update the current job and metadata context values. It should be called after installing the dependencies because the config may be influenced by config plugins. This function is automatically executed by the eas/build function group.

eas/resolve_apple_team_id_from_credentials function

The eas/resolve_apple_team_id_from_credentials function is only available for iOS builds. It resolves the Apple team ID value based on build credentials provided in the inputs.credentials. The resolved Apple team ID is stored in the outputs.apple_team_id output value. It has the following properties: name (optional, defaults to 'Resolve Apple team ID from credentials'), inputs.credentials (optional, json, defaults to ${ eas.job.secrets.buildCredentials }).

eas/prebuild function

The eas/prebuild function runs the expo prebuild command using the package manager (bun, npm, pnpm, or Yarn) detected based on your project with the command best suited for your build type and build environment.

eas/maestro_test built-in function

The eas/maestro_test is an all-in-one function that installs Maestro, prepares a testing environment (Android Emulator or iOS Simulator), and tests the app. Your project must be configured to use the old Build Infrastructure to start Android Emulator.

eas/maestro_test function inputs

The eas/maestro_test function has the following inputs: flow_path (required, string, path or multiple paths to Maestro flows to run), app_path (optional, string, path or regex pattern to emulator/simulator app that should be tested, defaults to android/app/build/outputs/**/\*.apk for Android and ios/build/Build/Products/*simulator/\*.app for iOS).

eas/maestro_test warning about Xcode versions

Maestro tests often time out if run on images with Xcode 15.0 or 15.2. Use the latest image to avoid any issues.

eas/find_and_upload_build_artifacts function purpose

The eas/find_and_upload_build_artifacts step automatically finds and uploads application archive, additional build artifacts, and Xcode logs from the default locations and using the buildArtifactPaths configuration, then uploads found artifacts to the EAS servers.

eas/find_and_upload_build_artifacts artifact upload limitation

You can currently upload each artifact type only once per build job. If you use eas/find_and_upload_build_artifacts while having buildArtifactPaths configured in your build profile and the step finds and uploads some build artifacts, any following eas/upload_artifact step will fail. To resolve this, remove buildArtifactPaths from custom build profiles and upload artifacts manually with eas/upload_artifact in the YAML if needed.

eas/upload_artifact function purpose and usage

The eas/upload_artifact step uploads files from the job's workspace as an artifact attached to the run. Uploaded artifacts appear in the run's Artifacts section and can be retrieved in a later job with eas/download_artifact.

eas/upload_artifact example with multiple files

Example showing how to upload artifacts with eas/upload_artifact: ```yaml build: name: Upload artifacts steps: - eas/checkout - eas/upload_artifact: name: Upload application archive inputs: path: fixtures/app-debug.apk - eas/upload_artifact: name: Upload artifacts inputs: type: build-artifact path: | assets/*.jpg assets/*.png ```

eas/install_maestro function and maestro_version input

The eas/install_maestro step makes sure Maestro, the mobile UI testing framework, is installed along with all its dependencies. It has one optional input: maestro_version (string), which specifies the Maestro version to install (for example, 1.35.0). If not provided, eas/install_maestro will install the latest version.

eas/start_android_emulator infrastructure requirement

Your project must be configured to use the old Build Infrastructure to start Android Emulator. Go to Project settings to configure this. See the changelog post for 2024-08-29 for more information.

eas/start_android_emulator inputs

The eas/start_android_emulator step has two optional inputs: device_name (string) - Name for the created device, useful when starting multiple emulators; system_image_package (string) - Android package path to use for the emulator, for example system-images;android-30;default;x86_64. To get available system images, run sdkmanager --list on a local computer. VMs run on x86_64 architecture, so always choose x86_64 package variants.

eas/start_ios_simulator device_identifier input

The eas/start_ios_simulator step has one optional input: device_identifier (string) - Name or UDID of the Simulator you want to start. Examples include iPhone [XY] Pro or AEF997BB-222C-4379-89BA-D21070B1D787. Available Simulators differ for every image, so if you change the image, the Simulator for a given name may become unavailable. For instance, an Xcode 14 image will have iPhone 14 Simulators, while an Xcode 15 image will have iPhone 15 simulators. In general, not providing this input is encouraged.

eas/send_slack_message with explicit webhook URL

Example of sending a Slack message with an explicit webhook URL: ```yaml build: name: Slack your team from custom build steps: - eas/send_slack_message: name: Send Slack message to a given webhook URL inputs: message: 'This is a message to plain input URL' slack_hook_url: 'https://hooks.slack.com/services/[rest_of_hook_url]' ```

eas/send_slack_message with default and secret environment variables

Example of sending Slack messages using default and specified secret environment variables: ```yaml build: steps: - eas/send_slack_message: name: Send Slack message to a default webhook URL from SLACK_HOOK_URL secret inputs: message: 'This is a test message to default URL from SLACK_HOOK_URL secret' - eas/send_slack_message: name: Send Slack message to a webhook URL from specified secret inputs: message: 'This is a test message to a URL from specified secret' slack_hook_url: ${ eas.env.ANOTHER_SLACK_HOOK_URL } ```

eas/send_slack_message conditional execution examples

Examples of conditional Slack messages using if conditions: ```yaml build: steps: - eas/build - eas/send_slack_message: if: ${ always() } name: Send Slack message when the build finishes inputs: message: 'Status: `${ steps.run_gradle.status_text }`' - eas/send_slack_message: if: ${ failure() } name: Send Slack message when the build fails inputs: message: 'Error: `${ steps.run_gradle.error_text }`' - eas/send_slack_message: if: ${ success() } name: Send Slack message when the build succeeds inputs: message: 'Build succeeded!' ```

eas/send_slack_message with Slack Block Kit layout

Example of sending a Slack message with Slack Block Kit layout: ```yaml build: steps: - eas/send_slack_message: if: ${ always() } name: Send Slack message with Slack Block Kit layout inputs: payload: blocks: - type: section text: type: mrkdwn text: |- Hello, Sir Developer *Your build has finished!* - type: divider - type: section text: type: mrkdwn text: |- *${ eas.env.EAS_BUILD_ID }* *Status:* `${ steps.run_gradle.status_text }` *Link:* `${ eas.job.expoBuildUrl }` accessory: type: image image_url: [your_image_url] alt_text: alt text for image - type: divider - type: actions elements: - type: button text: type: plain_text text: 'Do a thing :rocket:' emoji: true value: a_thing ```

eas/posthog_capture_event example

Example of capturing a PostHog event: ```yaml build: name: Build and mark the release in PostHog steps: - eas/build - eas/posthog_capture_event: name: Capture a PostHog event inputs: event: store_build_finished properties: platform: ios profile: production ```

eas/posthog_wait_for_metric example

Example of waiting for error count to stay low: ```yaml build: name: Gate on the error count steps: - eas/posthog_wait_for_metric: name: Wait for the error count to stay low inputs: query: SELECT count() FROM events WHERE event = '$exception' AND timestamp > now() - INTERVAL 15 MINUTE operator: lt threshold: 10 ```

eas/posthog_wait_for_query example

Example of waiting for a smoke test event: ```yaml build: name: Wait for a smoke test event steps: - eas/posthog_wait_for_query: name: Wait for the smoke test to pass inputs: query: SELECT count() > 0 FROM events WHERE event = 'smoke_test_passed' AND timestamp > now() - INTERVAL 30 MINUTE ```

eas/posthog_annotation example

Example of creating a PostHog annotation: ```yaml build: name: Annotate the release in PostHog steps: - eas/posthog_annotation: name: Create a PostHog annotation inputs: content: Published a production build ```

eas/posthog_upload_sourcemaps example

Example of exporting and uploading source maps: ```yaml build: name: Export and upload source maps steps: - eas/checkout - eas/install_node_modules - run: name: Export the bundle and source maps command: npx expo export --source-maps --platform ios - eas/posthog_upload_sourcemaps: name: Upload source maps to PostHog inputs: directory: dist ```

PostHog integration setup for EAS functions

To use PostHog functions (eas/posthog_capture_event, eas/posthog_flag_rollout, eas/posthog_wait_for_metric, eas/posthog_wait_for_query, eas/posthog_annotation, eas/posthog_upload_sourcemaps), run eas integrations:posthog:connect to link a PostHog project and set the environment variables these functions read. eas/posthog_capture_event uses your public project API key, while the other functions use a PostHog personal API key with specific scopes.

Give your agent this brain