Skip to content

Commit 8ee1f83

Browse files
cortinicofacebook-github-bot
authored andcommitted
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: #33068 Reviewed By: ShikaSD Differential Revision: D34083047 Pulled By: cortinico fbshipit-source-id: de34472d5737db445cfc0d4b1c6feaf1e746bb61
1 parent a75bbe7 commit 8ee1f83

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

.circleci/config.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -569,20 +569,18 @@ jobs:
569569
steps:
570570
- checkout
571571
- run_yarn
572+
- attach_workspace:
573+
at: .
572574

573575
- run:
574-
name: Setup the Android Template
576+
name: Create Android template project
575577
command: |
578+
REPO_ROOT=$(pwd)
579+
PACKAGE=$(cat build/react-native-package-version)
580+
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
576581
cd template
577-
# We replace the "react-native" dependency version with file:.. so we use it from source.
578-
sed -i 's/\"react-native\"\:.*/\"react-native\"\: \"file\:\.\.\"/g' package.json
582+
npm add $PATH_TO_PACKAGE
579583
npm install
580-
# react-native-community/cli is needed as the Android template is referencing a .gradle file inside it.
581-
npm i @react-native-community/cli
582-
583-
- run:
584-
name: Bundle the latest version of ReactAndroid
585-
command: ./gradlew :ReactAndroid:publishReleasePublicationToNpmRepository
586584
587585
- run:
588586
name: Build the template application
@@ -917,11 +915,6 @@ workflows:
917915
- build_npm_package:
918916
# Build a release package on every untagged commit, but do not publish to npm.
919917
publish_npm_args: --dry-run
920-
filters:
921-
branches:
922-
only:
923-
- main
924-
- /^pull\/.*$/
925918
- test_js:
926919
run_disabled_tests: false
927920
filters:
@@ -933,6 +926,8 @@ workflows:
933926
branches:
934927
ignore: gh-pages
935928
- test_android_template:
929+
requires:
930+
- build_npm_package
936931
filters:
937932
branches:
938933
ignore: gh-pages

0 commit comments

Comments
 (0)