diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 5ceb760a452b..91203a65b5ce 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -96,8 +96,8 @@ jobs: - name: Archive Android sourcemaps uses: actions/upload-artifact@v3 with: - name: android-sourcemap - path: android/app/build/generated/sourcemaps/react/release/*.map + name: android-sourcemap-${{ github.ref_name }} + path: android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map - name: Upload Android version to GitHub artifacts if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }} @@ -248,7 +248,7 @@ jobs: - name: Archive iOS sourcemaps uses: actions/upload-artifact@v3 with: - name: ios-sourcemap + name: ios-sourcemap-${{ github.ref_name }} path: main.jsbundle.map - name: Upload iOS version to GitHub artifacts diff --git a/ios/.xcode.env b/ios/.xcode.env index 3d5782c71568..0ef3f59d606a 100644 --- a/ios/.xcode.env +++ b/ios/.xcode.env @@ -9,3 +9,8 @@ # For example, to use nvm with brew, add the following line # . "$(brew --prefix nvm)/nvm.sh" --no-use export NODE_BINARY=$(command -v node) + +# Provide a sourcemap path so that in release builds a source map file will be +# created at the specified location. +# (RN's default behaviour on iOS is to skip creating a sourcemap file): +export SOURCEMAP_FILE="$(pwd)/../main.jsbundle.map"; diff --git a/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch b/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch new file mode 100644 index 000000000000..e8ca87026282 --- /dev/null +++ b/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch @@ -0,0 +1,37 @@ +diff --git a/node_modules/react-native/scripts/react-native-xcode.sh b/node_modules/react-native/scripts/react-native-xcode.sh +index d6c382b..3e1742c 100755 +--- a/node_modules/react-native/scripts/react-native-xcode.sh ++++ b/node_modules/react-native/scripts/react-native-xcode.sh +@@ -104,7 +104,7 @@ fi + + BUNDLE_FILE="$CONFIGURATION_BUILD_DIR/main.jsbundle" + +-EXTRA_ARGS= ++EXTRA_ARGS=() + + case "$PLATFORM_NAME" in + "macosx") +@@ -131,12 +131,12 @@ if [[ $EMIT_SOURCEMAP == true ]]; then + else + PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE" + fi +- EXTRA_ARGS="$EXTRA_ARGS --sourcemap-output $PACKAGER_SOURCEMAP_FILE" ++ EXTRA_ARGS+=("--sourcemap-output" "$PACKAGER_SOURCEMAP_FILE") + fi + + # Hermes doesn't require JS minification. + if [[ $USE_HERMES != false && $DEV == false ]]; then +- EXTRA_ARGS="$EXTRA_ARGS --minify false" ++ EXTRA_ARGS+=("--minify" "false") + fi + + "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \ +@@ -147,7 +147,7 @@ fi + --reset-cache \ + --bundle-output "$BUNDLE_FILE" \ + --assets-dest "$DEST" \ +- $EXTRA_ARGS \ ++ "${EXTRA_ARGS[@]}" \ + $EXTRA_PACKAGER_ARGS + + if [[ $USE_HERMES == false ]]; then diff --git a/workflow_tests/assertions/platformDeployAssertions.ts b/workflow_tests/assertions/platformDeployAssertions.ts index 24bb91f001f6..0df3e46d9b81 100644 --- a/workflow_tests/assertions/platformDeployAssertions.ts +++ b/workflow_tests/assertions/platformDeployAssertions.ts @@ -63,8 +63,9 @@ function assertAndroidJobExecuted(workflowResult: Step[], didExecute = true, isP } steps.push( createStepAssertion('Archive Android sourcemaps', true, null, 'ANDROID', 'Archiving Android sourcemaps', [ - {key: 'name', value: 'android-sourcemap'}, - {key: 'path', value: 'android/app/build/generated/sourcemaps/react/release/*.map'}, + // Note 1.2.3 comes from the ref name that we are on, which is the version we are deploying + {key: 'name', value: 'android-sourcemap-1.2.3'}, + {key: 'path', value: 'android/app/build/generated/sourcemaps/react/productionRelease/index.android.bundle.map'}, ]), ); if (!isProduction) { @@ -187,7 +188,8 @@ function assertIOSJobExecuted(workflowResult: Step[], didExecute = true, isProdu } steps.push( createStepAssertion('Archive iOS sourcemaps', true, null, 'IOS', 'Archiving sourcemaps', [ - {key: 'name', value: 'ios-sourcemap'}, + // Note 1.2.3 comes from the ref name that we are on, which is the version we are deploying + {key: 'name', value: 'ios-sourcemap-1.2.3'}, {key: 'path', value: 'main.jsbundle.map'}, ]), );