Skip to content

Commit 9b73aff

Browse files
authored
chore: Update main-dev for expo and release build configurations (#29572)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR updates build variants: - Create `main-dev-expo` for producing Expo debug dev builds (.app, .ipa, .apk, test .apk) - Update `main-dev` for producing release dev builds for installation via side loading Slack thread - https://consensys.slack.com/archives/C02U025CVU4/p1776795191936139 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-561 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because it changes CI build selection and iOS signing/export behavior (including overriding signing settings for Release archives), which could break artifact generation or produce incorrectly signed builds. > > **Overview** > Separates dev build configurations by introducing `main-dev-expo` (Debug Expo dev builds that produce simulator + device iOS artifacts and Android APK + test APK) while repurposing `main-dev` as a dev *release* build intended for sideloading. > > Updates the reusable `build.yml` workflow to support an optional `script_name` override from `builds.yml`, so different build configs can reuse the same underlying yarn build script. Adjusts `scripts/build.sh` iOS packaging to use a new `PROFILE` flag for selecting export options and to allow development signing overrides when creating a Release archive. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dc86270. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 70aa719 commit 9b73aff

4 files changed

Lines changed: 65 additions & 29 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ on:
6363
- main-e2e
6464
- main-exp
6565
- main-dev
66+
- main-dev-expo
6667
- flask-prod
6768
- flask-test
6869
- flask-e2e
@@ -113,6 +114,7 @@ jobs:
113114
signing_aws_role: ${{ steps.config.outputs.signing_aws_role }}
114115
signing_aws_secret: ${{ steps.config.outputs.signing_aws_secret }}
115116
signing_android_keystore_path: ${{ steps.config.outputs.signing_android_keystore_path }}
117+
script_name: ${{ steps.config.outputs.script_name }}
116118
checkout_ref_for_setup: ${{ !inputs.skip_version_bump && needs.update-build-version.outputs.commit-hash || (inputs.source_branch || github.ref_name) }}
117119
steps:
118120
- uses: actions/checkout@v4
@@ -142,6 +144,7 @@ jobs:
142144
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'signing_aws_role=' + (signing ? signing.aws_role || '' : '') + '\n');
143145
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'signing_aws_secret=' + (signing ? signing.aws_secret || '' : '') + '\n');
144146
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'signing_android_keystore_path=' + (signing && signing.android_keystore_path ? signing.android_keystore_path : '') + '\n');
147+
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'script_name=' + (build.script_name || '${{ inputs.build_name }}') + '\n');
145148
"
146149
147150
# Setup dependencies (no secrets) - uses reusable workflow on platform-specific runner
@@ -408,8 +411,8 @@ jobs:
408411
command: |
409412
export NODE_OPTIONS='--max-old-space-size=4096'
410413
export METRO_MAX_WORKERS='4'
411-
BUILD_NAME="${{ inputs.build_name }}"
412-
SCRIPT_NAME="build:${{ matrix.platform }}:${BUILD_NAME//-/:}"
414+
SCRIPT_BASE="${{ needs.prepare.outputs.script_name }}"
415+
SCRIPT_NAME="build:${{ matrix.platform }}:${SCRIPT_BASE//-/:}"
413416
yarn "$SCRIPT_NAME"
414417
415418
# Rename build artifacts (ios_simulator_path / ios_ipa_path / ios_archive_path / android_*_path outputs)

.github/workflows/expo-dev-build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
#
33
# Expo Dev Build — replaces the Bitrise expo_dev_pipeline.
44
#
5-
# Triggered on every push to main. Builds the main-dev configuration (Debug, simulator)
5+
# Triggered on every push to main. Builds the main-dev-expo configuration (Debug)
66
# for both iOS and Android using the reusable build.yml workflow.
77
#
8-
# No version bump or TestFlight upload — this is a dev/simulator build only.
9-
# Artifacts (iOS .app zip + Android APK) are uploaded as GitHub Actions artifacts.
8+
# Produces simulator .app + device IPA (iOS) and APK + test APK (Android).
9+
# No version bump or TestFlight upload.
10+
# Artifacts are uploaded as GitHub Actions artifacts.
1011
#
1112
# [skip ci] commits (e.g. version bumps) are automatically skipped by GitHub Actions.
1213
#
@@ -25,10 +26,10 @@ permissions:
2526

2627
jobs:
2728
build-dev:
28-
name: Expo dev build (main-dev)
29+
name: Expo dev build (main-dev-expo)
2930
uses: ./.github/workflows/build.yml
3031
with:
31-
build_name: main-dev
32+
build_name: main-dev-expo
3233
platform: both
3334
skip_version_bump: true
3435
secrets: inherit

builds.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# - env: sets environment variables directly (servers, build config, etc.)
1010
# - secrets: maps env var names to GitHub Secret names
1111
# - signing: (optional) AWS role + secret for code signing (omit for dev/simulator builds)
12+
# - script_name: (optional) yarn script base name override (defaults to the build key name)
1213
# - code_fencing: features to include via code fencing
1314
#
1415
# GitHub Environment determines actual secret values - builds.yml just maps the names.
@@ -285,8 +286,35 @@ builds:
285286
secrets: *secrets
286287
code_fencing: *code_fencing_experimental
287288

288-
# Local development / Expo development build (simulator .app + optional device IPA when IS_DEVICE_BUILD)
289+
# Dev release build (Ex. For sideloading via Build Mobile App workflow)
289290
main-dev:
291+
github_environment: build-dev
292+
signing: *signing_dev
293+
env:
294+
<<: *public_envs
295+
METAMASK_ENVIRONMENT: 'dev'
296+
METAMASK_BUILD_TYPE: 'main'
297+
MM_PORTFOLIO_URL: 'https://portfolio.dev-api.cx.metamask.io'
298+
MM_PREDICT_BUILDER_CODE: '0xd48300a99deac0f23265dad1f59d32920be33b75919201a88ed80f457f97b924'
299+
REWARDS_API_URL: 'https://rewards.uat-api.cx.metamask.io'
300+
BAANX_API_URL: 'https://dev.api.baanx.com'
301+
DIGEST_API_URL: 'https://digest.dev-api.cx.metamask.io/api/v1'
302+
SOCIAL_API_URL: 'https://social.dev-api.cx.metamask.io'
303+
BRIDGE_USE_DEV_APIS: 'true'
304+
RAMPS_ENVIRONMENT: 'staging'
305+
RAMP_INTERNAL_BUILD: 'true'
306+
RAMP_DEV_BUILD: 'true'
307+
IS_TEST: 'false'
308+
MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS: 'true'
309+
# TODO: Decouple configuration, profile, and build type
310+
PROFILE: 'development'
311+
DEV_OAUTH_CONFIG: 'true'
312+
secrets: *secrets
313+
code_fencing: *code_fencing_main
314+
315+
# Expo dev build (Debug, simulator + device — triggered on push to main)
316+
main-dev-expo:
317+
script_name: main-dev
290318
github_environment: build-dev
291319
signing: *signing_dev
292320
env:
@@ -308,6 +336,8 @@ builds:
308336
IS_SIM_BUILD: 'true'
309337
IS_DEVICE_BUILD: 'true'
310338
CONFIGURATION: 'Debug'
339+
# TODO: Decouple configuration, profile, and build type
340+
PROFILE: 'development'
311341
DEV_OAUTH_CONFIG: 'true'
312342
secrets: *secrets
313343
code_fencing: *code_fencing_main

scripts/build.sh

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -517,31 +517,25 @@ generateIosBinary() {
517517
exit 1
518518
fi
519519

520+
# PROFILE: 'development' or 'release' (set in builds.yml, defaults to 'release')
521+
local profile="${PROFILE:-release}"
522+
520523
if [ "$scheme" = "MetaMask" ] ; then
521-
# Main target
522-
if [ "$configuration" = "Debug" ] ; then
523-
# Debug configuration
524+
if [ "$profile" = "development" ] ; then
524525
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskDevelopment.plist"
525526
else
526-
# Release configuration
527527
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskRelease.plist"
528528
fi
529529
elif [ "$scheme" = "MetaMask-QA" ] ; then
530-
# QA target
531-
if [ "$configuration" = "Debug" ] ; then
532-
# Debug configuration
530+
if [ "$profile" = "development" ] ; then
533531
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskQADevelopment.plist"
534532
else
535-
# Release configuration
536533
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskQARelease.plist"
537534
fi
538535
elif [ "$scheme" = "MetaMask-Flask" ] ; then
539-
# Flask target
540-
if [ "$configuration" = "Debug" ] ; then
541-
# Debug configuration
536+
if [ "$profile" = "development" ] ; then
542537
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskFlaskDevelopment.plist"
543538
else
544-
# Release configuration
545539
exportOptionsPlist="MetaMask/IosExportOptionsMetaMaskFlaskRelease.plist"
546540
fi
547541
fi
@@ -551,17 +545,25 @@ generateIosBinary() {
551545
if [ "$IS_SIM_BUILD" = "true" ]; then
552546
echo "Binary build type: Simulator"
553547
xcodebuild -workspace MetaMask.xcworkspace -scheme $scheme -configuration $configuration -sdk iphonesimulator -derivedDataPath build
548+
fi
549+
550+
if [ "$IS_DEVICE_BUILD" = "true" ] || [ -z "$IS_SIM_BUILD" ]; then
551+
echo "Binary build type: Device"
554552

555-
# Also generate an .ipa to run on devices
556-
if [ "$IS_DEVICE_BUILD" = "true" ]; then
557-
echo "Binary build type: Device"
558-
xcodebuild -workspace MetaMask.xcworkspace -scheme $scheme -configuration $configuration archive -archivePath build/$scheme.xcarchive -destination generic/platform=ios
559-
echo "Generating ipa for $scheme"
560-
xcodebuild -exportArchive -archivePath build/$scheme.xcarchive -exportPath build/output -exportOptionsPlist $exportOptionsPlist
553+
# When PROFILE=development, override the signing settings so a Release
554+
# archive can be signed with the development certificate and profile
555+
# instead of the distribution identity hardcoded in the Xcode project.
556+
local -a archiveOverrides=()
557+
if [ "$profile" = "development" ] && [ "$configuration" = "Release" ]; then
558+
archiveOverrides=(
559+
CODE_SIGN_STYLE=Manual
560+
"PROVISIONING_PROFILE_SPECIFIER=development-metamask"
561+
"CODE_SIGN_IDENTITY=Apple Development"
562+
)
563+
echo "Overriding signing: using development certificate and profile for Release archive"
561564
fi
562-
else
563-
echo "Binary build type: Device"
564-
xcodebuild -workspace MetaMask.xcworkspace -scheme $scheme -configuration $configuration archive -archivePath build/$scheme.xcarchive -destination generic/platform=ios
565+
566+
xcodebuild -workspace MetaMask.xcworkspace -scheme "$scheme" -configuration "$configuration" archive -archivePath "build/$scheme.xcarchive" -destination generic/platform=ios "${archiveOverrides[@]}"
565567
echo "Generating ipa for $scheme"
566568
xcodebuild -exportArchive -archivePath build/$scheme.xcarchive -exportPath build/output -exportOptionsPlist $exportOptionsPlist
567569
fi

0 commit comments

Comments
 (0)