From 0924a28b196e331d18d7794cfcc9d4038dec9472 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 9 Feb 2022 08:23:43 -0800 Subject: [PATCH] Update `test_android_template` to use `build_npm_package` (#33068) Summary: I'm updating the `test_android_template` CI step to use the result of `build_npm_package` instead of sed-ing the RN version to `file:..`. This should be more robust and will allow to install transitive deps automatically, without having to deal with separate installation steps. This also fixes the broken CI for Android Changelog: [Internal] [Changed] - Update `test_android_template` to use `build_npm_package` Pull Request resolved: https://github.com/facebook/react-native/pull/33068 Reviewed By: ShikaSD Differential Revision: D34083047 Pulled By: cortinico fbshipit-source-id: de34472d5737db445cfc0d4b1c6feaf1e746bb61 --- .circleci/config.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7929266e83..7dc2e3a8375 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -569,20 +569,18 @@ jobs: steps: - checkout - run_yarn + - attach_workspace: + at: . - run: - name: Setup the Android Template + name: Create Android template project command: | + REPO_ROOT=$(pwd) + PACKAGE=$(cat build/react-native-package-version) + PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE" cd template - # We replace the "react-native" dependency version with file:.. so we use it from source. - sed -i 's/\"react-native\"\:.*/\"react-native\"\: \"file\:\.\.\"/g' package.json + npm add $PATH_TO_PACKAGE npm install - # react-native-community/cli is needed as the Android template is referencing a .gradle file inside it. - npm i @react-native-community/cli - - - run: - name: Bundle the latest version of ReactAndroid - command: ./gradlew :ReactAndroid:publishReleasePublicationToNpmRepository - run: name: Build the template application @@ -866,11 +864,6 @@ workflows: - build_npm_package: # Build a release package on every untagged commit, but do not publish to npm. publish_npm_args: --dry-run - filters: - branches: - only: - - main - - /^pull\/.*$/ - test_js: run_disabled_tests: false filters: @@ -882,6 +875,8 @@ workflows: branches: ignore: gh-pages - test_android_template: + requires: + - build_npm_package filters: branches: ignore: gh-pages