Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use next version of expo-dev-client in CI only if available #5612

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/check-expo-dev-client-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Check Expo dev-client nightly build
on:
workflow_call:
inputs:
expo-dev-client-dist-tag:
required: true
type: string

env:
SCRIPT_PATH: reanimated_repo/.github/workflows/helper/configureDevClient.js

jobs:
build_ios:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: macos-12
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
fail-fast: false
concurrency:
group: ios-expo-dev-client-${{ matrix.react-native-architecture }}-${{inputs.expo-dev-client-dist-tag}}${{ 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 app
- name: Install expo-dev-client
working-directory: app
run: npm install expo-dev-client@${{ inputs.expo-dev-client-dist-tag }}
- name: Setup configuration
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: app
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricIOS
- name: Install Pods
working-directory: app/ios
run: pod install
- name: Build app
working-directory: app
run: npx react-native run-ios --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 }}-${{inputs.expo-dev-client-dist-tag}}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out reanimated repository
uses: actions/checkout@v4
with:
path: 'reanimated_repo'
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Create Expo app
run: npx create-expo-app app
- name: Install expo-dev-client
working-directory: app
run: npm install expo-dev-client@${{ inputs.expo-dev-client-dist-tag }}
- name: Setup configuration
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: app
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricAndroid
- name: Build app
working-directory: app/android
run: ./gradlew assembleDebug --console=plain
78 changes: 4 additions & 74 deletions .github/workflows/check-expo-dev-client-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,14 @@ name: Check Expo dev-client nightly build
on:
pull_request:
paths:
- .github/workflows/check-expo-dev-client-action.yml
- .github/workflows/check-expo-dev-client-nightly.yml
- .github/workflows/check-expo-dev-client.yml
schedule:
- cron: '0 0 * * *' # after publishing new nightly version on NPM
workflow_dispatch:

env:
SCRIPT_PATH: reanimated_repo/.github/workflows/helper/configureDevClient.js

jobs:
build_ios:
if: github.repository == 'software-mansion/react-native-reanimated'
runs-on: macos-12
strategy:
matrix:
react-native-architecture: ['Paper', 'Fabric']
fail-fast: false
concurrency:
group: ios-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 app
- name: Install expo-dev-client
working-directory: app
run: npm install expo-dev-client@next
- name: Setup configuration
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: app
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricIOS
- name: Install Pods
working-directory: app/ios
run: pod install
- name: Build app
working-directory: app
run: yarn react-native run-ios --simulator='iPhone 14'

build_android:
call-check-expo-dev-client-workflow:
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 app
- name: Install expo-dev-client
working-directory: app
run: npm install expo-dev-client@next
- name: Setup configuration
run: node ${{ env.SCRIPT_PATH }} setBundleIdentifier
- name: Expo prebuild
working-directory: app
run: npx expo prebuild
- name: Install Reanimated
working-directory: app
run: npm install react-native-reanimated@nightly
- name: Set Fabric
if: ${{ matrix.react-native-architecture == 'Fabric' }}
run: node ${{ env.SCRIPT_PATH }} setupFabricAndroid
- name: Build app
working-directory: app/android
run: ./gradlew assembleDebug --console=plain
uses: ./.github/workflows/check-expo-dev-client.yml
32 changes: 32 additions & 0 deletions .github/workflows/check-expo-dev-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Expo dev-client nightly build
on:
workflow_call:
workflow_dispatch:

jobs:
check-expo-dev-client-next-availability:
runs-on: ubuntu-latest
steps:
- name: Check Expo dev-client next availability
id: check-next-availability
run: |
if npm dist-tag ls expo-dev-client | grep next
then
echo "::set-output name=status::true"
else
echo "::set-output name=status::false"
fi
outputs:
hasNext: ${{ steps.check-next-availability.outputs.status }}

check-expo-dev-client-next:
needs: check-expo-dev-client-next-availability
if: needs.check-expo-dev-client-next-availability.outputs.hasNext == 'true'
uses: ./.github/workflows/check-expo-dev-client-action.yml
with:
expo-dev-client-dist-tag: next

check-expo-dev-client-latest:
uses: ./.github/workflows/check-expo-dev-client-action.yml
with:
expo-dev-client-dist-tag: latest
Loading