Skip to content

Commit d683173

Browse files
chore: create an checkbox to upload the sourcemap in build mobile workflow (#27750)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Add an optional job to upload sourcemap to Sentry <img width="314" height="430" alt="Screenshot 2026-03-20 at 4 23 50 PM" src="https://github.com/user-attachments/assets/1680945f-268f-4c93-a04f-bb2e373b820c" /> Sentry: https://metamask.sentry.io/settings/projects/metamask-mobile/source-maps/?query=4123 ## **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: Added a checkbox to upload sourcemap on build mobile workflow ## **Related issues** Fixes: ## **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** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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** > Touches the mobile build/release pipeline and version numbering across Android/iOS/Bitrise, which can affect artifact reproducibility and release ordering if misconfigured. The Sentry upload toggle is opt-in but relies on correct environment auth and build scripts honoring `SENTRY_DISABLE_AUTO_UPLOAD`. > > **Overview** > Adds a new `upload_to_sentry` input to the GitHub Actions `build.yml` workflow and wires it to a `Configure Sentry upload` step that toggles `SENTRY_DISABLE_AUTO_UPLOAD` for the subsequent platform build. > > Updates build/version numbers used by the native projects and CI (`android/app/build.gradle`, `ios/MetaMask.xcodeproj/project.pbxproj`, and `bitrise.yml`) to align on `4138` (and adjusts Android `versionName`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0230a9c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
1 parent 88e375e commit d683173

4 files changed

Lines changed: 33 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
required: false
2121
type: string
2222
default: ''
23+
upload_to_sentry:
24+
description: 'If true, enable Sentry CLI upload of JS source maps and native debug symbols during the build'
25+
required: false
26+
type: boolean
27+
default: false
2328
workflow_dispatch:
2429
inputs:
2530
build_name:
@@ -47,6 +52,11 @@ on:
4752
required: false
4853
type: boolean
4954
default: false
55+
upload_to_sentry:
56+
description: 'Upload JS source maps and native debug symbols to Sentry during the build (requires Sentry auth in the build environment)'
57+
required: false
58+
type: boolean
59+
default: false
5060

5161
permissions:
5262
contents: read
@@ -310,6 +320,19 @@ jobs:
310320
cat ios/.xcode.env.local
311321
node --version
312322
323+
# Sentry: build.sh defaults SENTRY_DISABLE_AUTO_UPLOAD=true; set false only when opted in.
324+
- name: Configure Sentry upload
325+
env:
326+
UPLOAD_TO_SENTRY: ${{ inputs.upload_to_sentry }}
327+
run: |
328+
if [ "$UPLOAD_TO_SENTRY" = "true" ]; then
329+
echo "SENTRY_DISABLE_AUTO_UPLOAD=false" >> "$GITHUB_ENV"
330+
echo "✅ Sentry auto-upload enabled for this build"
331+
else
332+
echo "SENTRY_DISABLE_AUTO_UPLOAD=true" >> "$GITHUB_ENV"
333+
echo "ℹ️ Sentry auto-upload disabled"
334+
fi
335+
313336
# Build with retry logic. Timeouts: 55min per attempt, 115min total for step, 120min job
314337
- name: Build ${{ matrix.platform }}
315338
timeout-minutes: 115

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ android {
187187
applicationId "io.metamask"
188188
minSdkVersion rootProject.ext.minSdkVersion
189189
targetSdkVersion rootProject.ext.targetSdkVersion
190-
versionName "7.72.0"
191-
versionCode 3607
190+
versionName "7.71.0"
191+
versionCode 4138
192192
testBuildType System.getProperty('testBuildType', 'debug')
193193
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
194194
manifestPlaceholders.MM_BRANCH_KEY_TEST = "$System.env.MM_BRANCH_KEY_TEST"

bitrise.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,13 +3534,13 @@ app:
35343534
VERSION_NAME: 7.72.0
35353535
- opts:
35363536
is_expand: false
3537-
VERSION_NUMBER: 3911
3537+
VERSION_NUMBER: 4138
35383538
- opts:
35393539
is_expand: false
35403540
FLASK_VERSION_NAME: 7.72.0
35413541
- opts:
35423542
is_expand: false
3543-
FLASK_VERSION_NUMBER: 3911
3543+
FLASK_VERSION_NUMBER: 4138
35443544
- opts:
35453545
is_expand: false
35463546
ANDROID_APK_LINK: ''

ios/MetaMask.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@
12811281
CODE_SIGN_IDENTITY = "Apple Development";
12821282
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
12831283
CODE_SIGN_STYLE = Manual;
1284-
CURRENT_PROJECT_VERSION = 3911;
1284+
CURRENT_PROJECT_VERSION = 4138;
12851285
DEAD_CODE_STRIPPING = YES;
12861286
DEBUG_INFORMATION_FORMAT = dwarf;
12871287
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1350,7 +1350,7 @@
13501350
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
13511351
CODE_SIGN_IDENTITY = "iPhone Distribution";
13521352
CODE_SIGN_STYLE = Manual;
1353-
CURRENT_PROJECT_VERSION = 3911;
1353+
CURRENT_PROJECT_VERSION = 4138;
13541354
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
13551355
DEVELOPMENT_TEAM = 48XVW22RCG;
13561356
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
@@ -1416,7 +1416,7 @@
14161416
CODE_SIGN_IDENTITY = "Apple Development";
14171417
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
14181418
CODE_SIGN_STYLE = Manual;
1419-
CURRENT_PROJECT_VERSION = 3911;
1419+
CURRENT_PROJECT_VERSION = 4138;
14201420
DEAD_CODE_STRIPPING = YES;
14211421
DEBUG_INFORMATION_FORMAT = dwarf;
14221422
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1483,7 +1483,7 @@
14831483
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
14841484
CODE_SIGN_IDENTITY = "iPhone Distribution";
14851485
CODE_SIGN_STYLE = Manual;
1486-
CURRENT_PROJECT_VERSION = 3911;
1486+
CURRENT_PROJECT_VERSION = 4138;
14871487
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
14881488
DEVELOPMENT_TEAM = 48XVW22RCG;
14891489
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
@@ -1646,7 +1646,7 @@
16461646
CODE_SIGN_IDENTITY = "Apple Development";
16471647
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
16481648
CODE_SIGN_STYLE = Manual;
1649-
CURRENT_PROJECT_VERSION = 3911;
1649+
CURRENT_PROJECT_VERSION = 4138;
16501650
DEAD_CODE_STRIPPING = YES;
16511651
DEBUG_INFORMATION_FORMAT = dwarf;
16521652
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1716,7 +1716,7 @@
17161716
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
17171717
CODE_SIGN_IDENTITY = "iPhone Distribution";
17181718
CODE_SIGN_STYLE = Manual;
1719-
CURRENT_PROJECT_VERSION = 3911;
1719+
CURRENT_PROJECT_VERSION = 4138;
17201720
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
17211721
DEVELOPMENT_TEAM = 48XVW22RCG;
17221722
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;

0 commit comments

Comments
 (0)