Skip to content

Commit

Permalink
refactor: rework expo devclient and rnniightly nightlies
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Aug 9, 2024
1 parent 477e7cd commit 3b097c4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 114 deletions.
85 changes: 26 additions & 59 deletions .github/workflows/expo-devclient-build-check-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,88 +17,55 @@ jobs:
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
platform: ['iOS', 'Android']
fail-fast: false
env:
APP_NAME: ExpoApp
concurrency:
group: ios-expo-dev-client-${{ matrix.react-native-architecture }}-${{ github.ref }}
group: ${{ matrix.platform }}-expo-dev-client-${{ matrix.react-native-architecture }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out reanimated repository
uses: actions/checkout@v4
with:
path: 'reanimated_repo'
- name: Create Expo app
run: npx create-expo-app ExpoApp
- name: Install expo-dev-client
working-directory: ExpoApp
run: |
if npm view expo dist-tags | grep -q 'next:' ; then
npm install expo@next
else
npm install expo@latest
fi
- name: Setup configuration
working-directory: ExpoApp
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: ExpoApp
run: npx expo prebuild
- name: Install Reanimated
working-directory: ExpoApp
run: npm install react-native-reanimated@nightly
- name: Set Fabric
working-directory: ExpoApp
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricIOS
- name: Install Pods
working-directory: ExpoApp/ios
run: bundle install && bundle exec pod install
- name: Build app
working-directory: ExpoApp
run: npx react-native run-ios --simulator='iPhone 14' --terminal='Terminal'

build_android:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: ubuntu-latest
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
fail-fast: false
concurrency:
group: android-expo-dev-client-${{ matrix.react-native-architecture }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out reanimated repository
uses: actions/checkout@v4
with:
path: 'reanimated_repo'
- name: Create Expo app
run: npx create-expo-app ExpoApp
- name: Setup Java 17
if: ${{ matrix.platform == 'Android' }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Create Expo app
run: npx create-expo-app@latest ${{ env.APP_NAME }}
- name: Install expo-dev-client
working-directory: ExpoApp
working-directory: ${{ env.APP_NAME }}
run: |
if npm view expo dist-tags | grep -q 'next:' ; then
npm install expo@next
else
npm install expo@latest
fi
- name: Setup configuration
working-directory: ExpoApp
working-directory: ${{ env.APP_NAME }}
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: ExpoApp
working-directory: ${{ env.APP_NAME }}
run: npx expo prebuild
- name: Install Reanimated
working-directory: ExpoApp
working-directory: ${{ env.APP_NAME }}
run: npm install react-native-reanimated@nightly
- name: Set Fabric
working-directory: ExpoApp
if: ${{ matrix.react-native-architecture == 'Fabric' }}
- name: Set Fabric (iOS)
working-directory: ${{ env.APP_NAME }}
if: ${{ matrix.react-native-architecture == 'Fabric' && matrix.platform == 'iOS' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricIOS
- name: Set Fabric (Android)
working-directory: ${{ env.APP_NAME }}
if: ${{ matrix.react-native-architecture == 'Fabric' && matrix.platform == 'Android' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricAndroid
- name: Build app
working-directory: ExpoApp/android
- name: Build app (iOS)
working-directory: ${{ env.APP_NAME }}
if: ${{ matrix.platform == 'iOS' }}
run: npx react-native run-ios --simulator='iPhone 14' --terminal='Terminal'
- name: Build app (Android)
working-directory: ${{ env.APP_NAME }}
if: ${{ matrix.platform == 'Android' }}
run: ./gradlew assembleDebug --console=plain
Original file line number Diff line number Diff line change
Expand Up @@ -14,77 +14,55 @@ jobs:
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
platform: ['iOS', 'Android']
fail-fast: false
env:
REACT_NATIVE_TAG: nightly
APP_NAME: app
concurrency:
group: ios-react-native-nightly-${{ matrix.react-native-architecture }}-${{ github.ref }}
group: ${{ matrix.platform }}-react-native-nightly-${{ matrix.react-native-architecture }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Setup Yarn
# Sometimes `npx react-native init` fails due to dependency mismatches or other
# rather vague errors. This is a workaround for that.
run: corepack enable && yarn init
- name: Create app
run: |
if npm view react-native dist-tags | grep -q 'next:' ; then
yarn add react-native@next && yarn react-native init app --skip-install --version next
else
yarn add react-native@nightly && yarn react-native init app --skip-install --version nightly
fi
- name: Enable Yarn in app
working-directory: app
run: touch yarn.lock
- name: Install Reanimated
working-directory: app
run: yarn add react-native-reanimated@https://github.com/software-mansion/react-native-reanimated.git#commit=${{ github.sha }}
- name: Install Paper Pods
if: ${{ matrix.react-native-architecture == 'Paper' }}
working-directory: app/ios
run: bundle install && bundle exec pod install
- name: Install Fabric Pods
if: ${{ matrix.react-native-architecture == 'Fabric' }}
working-directory: app/ios
run: RCT_NEW_ARCH_ENABLED=1 bundle install && bundle exec pod install
- name: Build app
working-directory: app
run: yarn react-native run-ios --simulator='iPhone 14'

build_android:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: ubuntu-latest
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
fail-fast: false
concurrency:
group: android-react-native-nightly-${{ matrix.react-native-architecture }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Set up JDK 18
if: ${{ matrix.platform == 'Android' }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '18'
- name: Setup Yarn
# Sometimes `npx react-native init` fails due to dependency mismatches or other
# rather vague errors. This is a workaround for that.
run: corepack enable && yarn init
- name: Create app
- name: Load "next" tag if available
run: |
if npm view react-native dist-tags | grep -q 'next:' ; then
yarn add react-native@next && yarn react-native init app --skip-install --version next
else
yarn add react-native@nightly && yarn react-native init app --skip-install --version nightly
if npm view react-native dist-tags | grep -q 'next:' ; then
echo "REACT_NATIVE_TAG=next" >> $GITHUB_ENV
fi
- name: Enable Yarn in app
working-directory: app
run: touch yarn.lock
- name: Install React Native
run: yarn add react-native@${{ env.REACT_NATIVE_TAG }}
- name: Create app
run: |
yarn react-native init ${{ env.APP_NAME }} --version ${{ env.REACT_NATIVE_TAG }} --pm yarn --skip-install --install-pods false --skip-git-init
- name: Install Reanimated
working-directory: app
working-directory: ${{ env.APP_NAME }}
run: yarn add react-native-reanimated@https://github.com/software-mansion/react-native-reanimated.git#commit=${{ github.sha }}
- name: Setup Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
working-directory: app/android
- name: Install Paper Pods (iOS)
if: ${{ matrix.react-native-architecture == 'Paper' && matrix.platform == 'iOS' }}
working-directory: app/ios
run: bundle install && bundle exec pod install
- name: Install Fabric Pods (iOS)
if: ${{ matrix.react-native-architecture == 'Fabric' && matrix.platform == 'iOS' }}
working-directory: app/ios
run: RCT_NEW_ARCH_ENABLED=1 bundle install && bundle exec pod install
- name: Setup Fabric (Android)
if: ${{ matrix.react-native-architecture == 'Fabric' && matrix.platform == 'Android' }}
working-directory: ${{ env.APP_NAME }}/android
run: sed -i 's/newArchEnabled=false/newArchEnabled=true/' gradle.properties
- name: Build app
working-directory: app/android
- name: Build app (iOS)
if: ${{ matrix.platform == 'iOS' }}
working-directory: ${{ env.APP_NAME }}
run: yarn react-native run-ios --simulator='iPhone 14'
- name: Build app (Android)
if: ${{ matrix.platform == 'Android' }}
working-directory: ${{ env.APP_NAME }}/android
run: ./gradlew assembleDebug --console=plain

0 comments on commit 3b097c4

Please sign in to comment.