Skip to content

Commit

Permalink
Update test_android_template to use npm pack
Browse files Browse the repository at this point in the history
I'm updating the `test_android_template` CI step to use npm pack 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 `npm pack`
  • Loading branch information
cortinico committed Feb 8, 2022
1 parent cd79317 commit dea474a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,18 @@ jobs:
- checkout
- run_yarn

- run:
name: Bundle the latest version of ReactAndroid
command: ./gradlew :ReactAndroid:publishReleasePublicationToNpmRepository

- run:
name: Setup the Android Template
command: |
# We pack the NPM package and install it with npm add.
npm pack
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 ../react-native-1000.0.0.tgz
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
Expand Down

0 comments on commit dea474a

Please sign in to comment.