Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
349dedc
chore: draft
makemesteaks Sep 12, 2025
cc39d5e
chore: rebase
makemesteaks Sep 12, 2025
617d40b
chore: expo fingerprint update
makemesteaks Sep 12, 2025
2428cec
chore: yarn lock
makemesteaks Sep 12, 2025
35b04e3
chore: expo
makemesteaks Sep 12, 2025
2a9ee52
chore: yarn lock
makemesteaks Sep 12, 2025
0b4c72b
chore: update
makemesteaks Sep 12, 2025
f3e08a3
chore: generate fingerprint test
makemesteaks Sep 12, 2025
7bc95c2
chore: dont run ios
makemesteaks Sep 12, 2025
4f4fc01
chore: no retries
makemesteaks Sep 12, 2025
2c424ec
chore: update
makemesteaks Sep 12, 2025
86e6963
chore: updatefunc
makemesteaks Sep 12, 2025
5230cca
chore: check if fingerprint works
makemesteaks Sep 12, 2025
e7dc9d1
chore: fingerprint before setup env
makemesteaks Sep 12, 2025
d97adcd
Revert "chore: fingerprint before setup env"
makemesteaks Sep 12, 2025
0ec7465
chore: fingerprint ignore
makemesteaks Sep 12, 2025
5fea43d
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 15, 2025
4fe489b
fix(ci): resolve fingerprint generation bug and improve build caching
Qbandev Sep 15, 2025
2da5555
chore: implement copilot comments
Qbandev Sep 15, 2025
63a95c6
chore: fix linting
Qbandev Sep 15, 2025
9942c09
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 15, 2025
4a04df8
Update docs/build-caching.md
Qbandev Sep 15, 2025
bdbdbf5
fix: remove alert related to repack package
Qbandev Sep 15, 2025
49b9b2c
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 15, 2025
e20059b
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 15, 2025
e4dd706
chore: enable commented workflow
Qbandev Sep 15, 2025
1ae30b3
feat(infra): add iOS support and unify build caching architecture
Qbandev Sep 16, 2025
3bd53e8
chore: add files
Qbandev Sep 16, 2025
5598e08
chore: reduce PR size
Qbandev Sep 16, 2025
77e7cd1
chore: prettier
Qbandev Sep 16, 2025
eb7de72
chore: fix syntax
Qbandev Sep 16, 2025
4be532a
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 16, 2025
368de41
chore: fix syntax errors
Qbandev Sep 16, 2025
da828fa
chore: push latest changes
Qbandev Sep 16, 2025
5505cac
fix: resolve ESLint errors and GitHub Actions syntax issues
Qbandev Sep 16, 2025
78d30e1
fix: correct bash script structure in fingerprint-build-check action
Qbandev Sep 16, 2025
9ee806b
refactor: extract fingerprint logic into separate scripts
Qbandev Sep 16, 2025
cf83732
refactor: extract fingerprint logic into separate scripts
Qbandev Sep 16, 2025
2f918b3
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 16, 2025
2066c3a
chore: remove documentation
Qbandev Sep 16, 2025
4c39e59
fix: fingerprint-build-check
Qbandev Sep 16, 2025
c1347e8
chore: update readme and trigger build
Qbandev Sep 16, 2025
14445e4
fix: reduce PR size and simplify
Qbandev Sep 16, 2025
7e8b822
fix: lint error
Qbandev Sep 16, 2025
40ae9b6
chore: remove file not needed
Qbandev Sep 16, 2025
761a7e6
fix: improve fingerprint cache
Qbandev Sep 16, 2025
24a9db6
fix: handle dynamic bundle paths from expo export
Qbandev Sep 16, 2025
7b4f649
fix: use unified repack command for Android workflow
Qbandev Sep 16, 2025
36cdde0
feat: enhance repack-app.js with robust error handling
Qbandev Sep 16, 2025
64a2285
fix: lint error package
Qbandev Sep 16, 2025
be10cbc
feat: simplify build caching to use only check-fingerprint.js
Qbandev Sep 16, 2025
f37106d
fix: simplify all the workflows
Qbandev Sep 16, 2025
78c74cd
fix: lint error package
Qbandev Sep 17, 2025
39f20df
fix: lint error check-fingerprint
Qbandev Sep 17, 2025
2b4a597
fix: cache file name
Qbandev Sep 17, 2025
295d51e
feat: improve fingerprint caching
Qbandev Sep 17, 2025
aedcd15
fix: fingerprint cache
Qbandev Sep 17, 2025
fa2314f
fix: simplify the cache and fingerprint
Qbandev Sep 17, 2025
7c73cd4
fix: repack platform
Qbandev Sep 17, 2025
1a6e8da
fix: repack app
Qbandev Sep 17, 2025
41ebc2a
fix: repack app code
Qbandev Sep 17, 2025
ff0a641
fix: simplify cache logic
Qbandev Sep 17, 2025
9a0f43d
fix: simplify cache logic in workflows
Qbandev Sep 17, 2025
7c33db8
chore: test repack json
Qbandev Sep 17, 2025
c8aa4b9
fix: repack app json
Qbandev Sep 17, 2025
3ed8587
fix: repack app temp
Qbandev Sep 17, 2025
f4175ec
fix: use metro bundle
Qbandev Sep 17, 2025
92f6297
fix: add source map
Qbandev Sep 17, 2025
37261c0
fix: remove repack
Qbandev Sep 17, 2025
8437f80
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 17, 2025
4380d3f
fix: bundle pipeline
Qbandev Sep 18, 2025
c3d690c
fix: package prettier
Qbandev Sep 18, 2025
02422c7
fix: package debug
Qbandev Sep 18, 2025
0cb1059
fix: improve caching
Qbandev Sep 18, 2025
ff4dd8e
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 18, 2025
9cc0358
fix: improve caching android
Qbandev Sep 18, 2025
48386fe
chore: show fingerprint
Qbandev Sep 18, 2025
1bd3597
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 18, 2025
dbdb408
fix: improve source map and apk
Qbandev Sep 18, 2025
4a95bc0
fix: improve android bundle
Qbandev Sep 18, 2025
c8e41f5
fix: improve android repack signature
Qbandev Sep 18, 2025
9fae645
fix: apk signature
Qbandev Sep 18, 2025
4558745
fix: apk structure
Qbandev Sep 18, 2025
8b6e48b
fix: improve android bundle with gradle
Qbandev Sep 18, 2025
a4bcd04
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 18, 2025
eee0b57
fix: start testing repack again
Qbandev Sep 19, 2025
8735318
chore: prettier package.json
Qbandev Sep 19, 2025
871951f
fix: remove steps not used
Qbandev Sep 19, 2025
1c152a4
fix: improve repack config
Qbandev Sep 19, 2025
aea5f40
fix: repack bug
Qbandev Sep 19, 2025
f548df6
fix: remove bundle config
Qbandev Sep 19, 2025
479576c
fix: repack logic
Qbandev Sep 19, 2025
efeece3
fix: improve repack logic with bogbot comments
Qbandev Sep 19, 2025
89fd553
fix: improve repack script to use the api
Qbandev Sep 19, 2025
8967cc9
fix: improve cross-device link not permitted in repack script
Qbandev Sep 19, 2025
35a93c0
fix: improve repack script apk path
Qbandev Sep 19, 2025
f757c10
fix: improve repack signed
Qbandev Sep 19, 2025
cf6b853
fix: reapck both main and test
Qbandev Sep 19, 2025
4479c8c
fix: sign test apk
Qbandev Sep 19, 2025
f6be4af
fix: remove zipalign
Qbandev Sep 19, 2025
10b029e
fix: use qa keystore
Qbandev Sep 22, 2025
738430a
fix: improve repack script for both ios and android
Qbandev Sep 23, 2025
2eaa147
chore: prettier package.json
Qbandev Sep 23, 2025
db2744a
feat: direct bundle replacement ios
Qbandev Sep 23, 2025
722a26d
chore: rename ios repack steps
Qbandev Sep 23, 2025
a8cf261
fix: ios repack env vars
Qbandev Sep 23, 2025
61b9746
fix: ios build and repack env vars
Qbandev Sep 23, 2025
323dfb5
fix: ios build and repack env vars
Qbandev Sep 23, 2025
905b4af
fix: ios build repack
Qbandev Sep 23, 2025
dda5994
fix: Remap ios repack environment variables
Qbandev Sep 23, 2025
7122122
fix: ios repack bundle script
Qbandev Sep 23, 2025
c32a196
fix: ios repack bundle script path
Qbandev Sep 23, 2025
5f96f89
fix: ios repack bundle script
Qbandev Sep 24, 2025
bf51cb1
chore: try cocoa pod cache
Qbandev Sep 24, 2025
0414f7c
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 24, 2025
e281899
chore: minor comments
Qbandev Sep 24, 2025
6ff91ce
chore: minor copilot fixes
Qbandev Sep 24, 2025
017e257
fix: prettier format
Qbandev Sep 24, 2025
be98d37
chore: update repack
Qbandev Sep 24, 2025
1e8fad0
fix: comment log in repack
Qbandev Sep 24, 2025
b9bef4c
fix: improve fingerprint cache restore
Qbandev Sep 24, 2025
103667d
Merge branch 'main' into infra-2854-cache-builds
Qbandev Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ignores:
# Appium drivers are used by Appwright for mobile automation
- 'appium-uiautomator2-driver'
- 'appium-xcuitest-driver'
# Used in scripts/repack-android-e2e.js for CI optimization
- '@expo/repack-app'

# Note: Everything below this line should be removed after investigation
# TODO: Investigate each dependency to see whether it's used
Expand Down
39 changes: 39 additions & 0 deletions .fingerprintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Ignore scripts directory - changes here don't affect native builds
scripts/**/*

# Ignore CI/CD and workflow files
.github/**/*

# Ignore documentation and markdown files
*.md
docs/**/*
LICENSE
attribution.txt

# Ignore workflow files
**/*.yml

# Ignore SonarQube config
sonar-project.properties

# Ignore test files that don't affect native builds
**/*.test.js
**/*.test.ts
**/*.test.tsx
**/*.spec.js
**/*.spec.ts
**/*.spec.tsx

# Ignore e2e test files
e2e/**/*
wdio/**/*

# Ignore linting and formatting configs
.eslintrc*
.prettierrc*
.eslintignore
.prettierignore

# Ignore yarn/npm lock files for stability
yarn.lock
package-lock.json
89 changes: 88 additions & 1 deletion .github/workflows/build-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
apk-uploaded: ${{ steps.upload-apk.outcome == 'success' }}
aab-uploaded: ${{ steps.upload-aab.outcome == 'success' }}
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,7 +60,29 @@ jobs:
echo "🚀 Setting up project..."
yarn setup:github-ci --no-build-ios

# Generate fingerprint AFTER setup but BEFORE any build modifications
- name: Generate current fingerprint
id: generate-fingerprint
run: |
FINGERPRINT=$(yarn -s fingerprint:generate)
echo "fingerprint=$FINGERPRINT" >> "$GITHUB_OUTPUT"
echo "Current fingerprint: ${FINGERPRINT}"

- name: Check and restore cached APKs
id: cache-restore
uses: actions/cache@v4
with:
path: |
android/app/build/outputs/apk/prod/release/app-prod-release.apk
android/app/build/outputs/apk/androidTest/prod/release/app-prod-release-androidTest.apk
android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
key: android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}
restore-keys: |
android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}
android-apk-

- name: Build Android E2E APKs
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }}
run: |
echo "🏗 Building Android E2E APKs..."
export NODE_OPTIONS="--max-old-space-size=8192"
Expand Down Expand Up @@ -103,6 +125,71 @@ jobs:
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}

- name: Repack APK with JS updates using @expo/repack-app
if: ${{ steps.cache-restore.outputs.cache-hit == 'true' }}
run: |
echo "📦 Repacking APK with updated JavaScript bundle using @expo/repack-app..."

# Use the optimized repack script which uses @expo/repack-app
yarn repack:android

# Verify the repacked APK exists
APK_PATH="android/app/build/outputs/apk/prod/release/app-prod-release.apk"
if [ ! -f "$APK_PATH" ]; then
echo "❌ Error: APK not found at $APK_PATH after repack"
exit 1
fi

echo "✅ APK successfully repacked with @expo/repack-app"
echo "📦 Final APK size: $(du -h "$APK_PATH" | cut -f1)"

env:
# Pass ALL the same environment variables as the original build to ensure identical JS bundle
PLATFORM: android
METAMASK_ENVIRONMENT: qa
METAMASK_BUILD_TYPE: main
IS_TEST: true
E2E: "true"
IGNORE_BOXLOGS_DEVELOPMENT: true
GITHUB_CI: "true"
CI: "true"
NODE_OPTIONS: "--max-old-space-size=8192"
MM_UNIFIED_SWAPS_ENABLED: "true"
MM_BRIDGE_ENABLED: "true"
BRIDGE_USE_DEV_APIS: "true"
RAMP_INTERNAL_BUILD: "true"
SEEDLESS_ONBOARDING_ENABLED: "true"
MM_NOTIFICATIONS_UI_ENABLED: "true"
MM_SECURITY_ALERTS_API_ENABLED: "true"
MM_REMOVE_GLOBAL_NETWORK_SELECTOR: "true"
BLOCKAID_FILE_CDN: "static.cx.metamask.io/api/v1/confirmations/ppom"
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}
MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}
MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}

# Cache build artifacts with the pre-build fingerprint
- name: Cache build artifacts
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }}
uses: actions/cache@v4
with:
path: |
android/app/build/outputs/apk/prod/release/app-prod-release.apk
android/app/build/outputs/apk/androidTest/prod/release/app-prod-release-androidTest.apk
android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
key: android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}

- name: Upload Android APK
id: upload-apk
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/build-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ jobs:
restore-keys: |
${{ runner.os }}-xcode-

# Cache CocoaPods to speed up pod install
- name: Cache CocoaPods
uses: actions/cache@v4
with:
path: ios/Pods
key: pods-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
pods-${{ runner.os }}-

# Install Node.js, Xcode tools, and other iOS development dependencies
- name: Installing iOS Environment Setup
uses: MetaMask/github-tools/.github/actions/setup-e2e-env@f932aba72712f44367f89f6e259ea0c8cfedcf68
Expand Down Expand Up @@ -103,12 +112,11 @@ jobs:
command: |
echo "🚀 Setting up project..."
yarn setup:github-ci --build-ios --no-build-android

# Build the iOS E2E app for simulator
- name: Build iOS E2E App
run: |
echo "🏗 Building iOS E2E App..."
export NODE_OPTIONS="--max-old-space-size=8192"
yarn build:ios:main:e2e
shell: bash
env:
Expand All @@ -121,7 +129,7 @@ jobs:
GITHUB_CI: "true"
CI: "true"

NODE_OPTIONS: "--max_old_space_size=4096" # Increase memory limit for build
NODE_OPTIONS: "--max-old-space-size=4096" # Increase memory limit for build

SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
Expand Down
3 changes: 3 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ module.exports = {

'expo-apple-authentication',
],
android: {
package: 'io.metamask', // Required for @expo/repack-app Android repacking
},
ios: {
usesAppleSignIn: true,
},
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
"build:android:main:test": "./scripts/build.sh android main test",
"build:android:main:e2e": "./scripts/build.sh android main e2e",
"build:android:flask:prod": "./scripts/build.sh android flask production",
"fingerprint:generate": "node scripts/generate-fingerprint.js",
"repack:android": "node scripts/repack-e2e.js",
"build:android:flask:local": "./scripts/build.sh android flask local",
"build:android:flask:test": "./scripts/build.sh android flask test",
"build:android:flask:e2e": "./scripts/build.sh android flask e2e",
Expand Down Expand Up @@ -215,6 +217,7 @@
"@craftzdog/react-native-buffer": "^6.1.0",
"@deeeed/hyperliquid-node20": "^0.23.1-node20.1",
"@ethersproject/abi": "^5.7.0",
"@expo/fingerprint": "^0.15.0",
"@keystonehq/bc-ur-registry-eth": "^0.21.0",
"@keystonehq/ur-decoder": "^0.12.2",
"@lavamoat/react-native-lockdown": "^0.0.2",
Expand Down Expand Up @@ -502,6 +505,7 @@
"zxcvbn": "4.4.2"
},
"devDependencies": {
"@expo/repack-app": "^0.2.9",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/preset-env": "^7.25.3",
Expand Down
15 changes: 15 additions & 0 deletions scripts/generate-fingerprint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { createFingerprintAsync } = require('@expo/fingerprint');

async function generateFingerprint() {
try {
const { hash } = await createFingerprintAsync(process.cwd(), { mode: 'prebuild' });
// Only output the hash to stdout, no console.log or extra output
process.stdout.write(hash);
} catch (error) {
// Write error to stderr instead of stdout to avoid corrupting the hash output
process.stderr.write(`Error generating fingerprint: ${error.message}\n`);
process.exit(1);
}
}

generateFingerprint();
Loading
Loading