Skip to content

Commit 563cd5d

Browse files
committed
setup matrix for iOS build
1 parent c7ad75b commit 563cd5d

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.github/workflows/eas-build.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,26 @@ on:
4646

4747
jobs:
4848
Build:
49-
runs-on: macos-latest
49+
runs-on: ${{ matrix.os }}
5050
environment: app-${{ inputs.environment }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
platform: [ios, android]
55+
include:
56+
- platform: ios
57+
os: macos-latest
58+
- platform: android
59+
os: ubuntu-latest
5160
steps:
61+
- name: Do not run ios matrix if ios input is false
62+
if: ${{ inputs.ios == false }} && ${{ matrix.platform == 'ios' }}
63+
run: exit 1
64+
65+
- name: Do not run android matrix if android input is false
66+
if: ${{ inputs.android == false }} && ${{ matrix.platform == 'android' }}
67+
run: exit 1
68+
5269
- name: Check for EXPO_TOKEN
5370
run: |
5471
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
@@ -76,10 +93,5 @@ jobs:
7693
- name: ⚙️ Run Prebuild
7794
run: pnpm prebuild:${{ inputs.environment }}
7895

79-
- name: 📱 Run Android Build
80-
if: ${{ inputs.android == true }}
81-
run: pnpm build:${{ inputs.environment }}:android --non-interactive --no-wait --message "Build ${{ inputs.environment }}" --local --non-interactive
82-
83-
- name: 📱 Run IOS Build
84-
if: ${{ inputs.ios == true }}
85-
run: pnpm build:${{ inputs.environment }}:ios --non-interactive --no-wait --message "Build ${{ inputs.environment }}" --local --non-interactive
96+
- name: 📱 Run Build for ${{ matrix.platform }}
97+
run: pnpm build:${{ inputs.environment }}:${{ matrix.platform }} --non-interactive --no-wait --message "Build ${{ inputs.environment }} for ${{ matrix.platform }}" --local

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"build:qa:ios": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 eas build --profile qa --platform ios",
2626
"build:qa:web": "cross-env APP_ENV=qa EXPO_NO_DOTENV=1 expo export -c --platform web",
2727
"credentials:qa:ios": "APP_ENV=qa eas credentials:configure-build --profile=qa --platform ios",
28+
"credentials:qa:android": "APP_ENV=qa eas credentials:configure-build --profile=qa --platform android",
2829
"submit:qa:mobile": "cross-env APP_ENV=qa eas submit",
2930
"start:staging": "cross-env APP_ENV=staging pnpm run start",
3031
"prebuild:staging": "cross-env APP_ENV=staging pnpm run prebuild",
@@ -159,4 +160,4 @@
159160
"url": "git+https://github.com/rootstrap/react-native-template.git"
160161
},
161162
"packageManager": "[email protected]"
162-
}
163+
}

0 commit comments

Comments
 (0)