Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ jobs:
env:
VERSION: ${{ env.VERSION_CODE }}

- name: Archive Android sourcemaps
uses: actions/upload-artifact@v3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting here that even though we normally use SHAs for community actions instead of vX tags, I think it might be fine to make exceptions for GitHub-maintained actions in the actions/ org.

What do you think @AndrewGable ?

with:
name: android-sourcemap
path: android/app/build/generated/sourcemaps/react/release/*.map

- name: Warn deployers if Android production deploy failed
if: ${{ failure() && fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
uses: 8398a7/action-slack@v3
Expand Down Expand Up @@ -244,6 +250,12 @@ jobs:
APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }}
APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }}

- name: Archive iOS sourcemaps
uses: actions/upload-artifact@v3
with:
name: ios-sourcemap
path: main.jsbundle.map

- name: Set iOS version in ENV
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: echo "IOS_VERSION=$(echo '${{ github.event.release.tag_name }}' | tr '-' '.')" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
shellScript = "export NODE_BINARY=node\nexport EXTRA_PACKAGER_ARGS=\"--sourcemap-output $(pwd)/../main.jsbundle.map\"\n\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
0819B9EA2AC16F5E4380192C /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"gh-actions-build": "./.github/scripts/buildActions.sh",
"gh-actions-validate": "./.github/scripts/validateActionsAndWorkflows.sh",
"analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.common.js --env.envFile=.env.production",
"check-metro-bundler-port": "node config/checkMetroBundlerPort.js"
"check-metro-bundler-port": "node config/checkMetroBundlerPort.js",
"symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these scripts used by react native automatically?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these scripts used by react native automatically?

I'm not sure what do you mean - how would they be used automatically by react-native?

I've outlined sample usage in the "Details" section.

Something like this:

  1. Build pipeline runs and saves sourcemaps somewhere
  2. Firebase Crashlytics captures a crash
  3. Something uses crash report data to retrieve the source maps for the build (version)
  4. And runs npm run symbolicate:{platform} < crashlytics.stactrace.txt where .stacktrace.txt are js stack traces from "Firebase Crashlytics"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the explanation. Sounds like a good plan

"symbolicate:ios": "npx metro-symbolicate main.jsbundle.map"
},
"dependencies": {
"@formatjs/intl-getcanonicallocales": "^1.5.8",
Expand Down