Skip to content

Commit 424a441

Browse files
ci: eas build on dev
1 parent 4e9fde1 commit 424a441

File tree

4 files changed

+55
-24
lines changed

4 files changed

+55
-24
lines changed

.github/actions/eas-deploy-android/action.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ inputs:
77
LEATHER_BOT:
88
description: 'GH bot token'
99
required: true
10+
IS_MAIN_BRANCH:
11+
description: 'Boolean value to identify if this is running on the main branch or not'
12+
required: true
13+
1014
runs:
1115
using: 'composite'
1216
steps:
1317
- name: Prepare the app
1418
uses: ./.github/actions/provision
1519

16-
- name: Extract branch name
17-
shell: bash
18-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
19-
id: extract_branch
20-
2120
- name: Setup Expo and EAS
2221
uses: expo/expo-github-action@v8
2322
with:
@@ -35,7 +34,7 @@ runs:
3534
id: android_simulator_build
3635
run: |
3736
cd apps/mobile
38-
if [[ "$BRANCH_NAME" == "dev" ]]
37+
if [[ "$IS_MAIN_BRANCH" == "true" ]]
3938
then
4039
# No wait on simulator version build of the app if we are on a dev branch
4140
eas build --platform android --profile=simulator-dev --non-interactive --no-wait
@@ -61,10 +60,10 @@ runs:
6160
fi
6261
shell: bash
6362
env:
64-
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
63+
IS_MAIN_BRANCH: ${{ inputs.IS_MAIN_BRANCH }}
6564

6665
- name: Publish Android expo build link in PR
67-
if: ${{ steps.extract_branch.outputs.branch != 'dev' }}
66+
if: ${{ inputs.IS_MAIN_BRANCH == 'false' }}
6867
uses: actions/github-script@v7
6968
env:
7069
BUILD_LINK: ${{ steps.android_simulator_build.outputs.BUILD_LINK }}
@@ -82,7 +81,7 @@ runs:
8281
}
8382
8483
- name: 🛫 Build for production 🛫
85-
if: ${{ steps.extract_branch.outputs.branch == 'dev' }}
84+
if: ${{ inputs.IS_MAIN_BRANCH == 'true' }}
8685
run: |
8786
cd apps/mobile
8887
# Release version of the app, we should wait for it to see the result

.github/actions/eas-deploy-ios/action.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ inputs:
1616
LEATHER_BOT:
1717
description: 'GH bot token'
1818
required: true
19+
IS_MAIN_BRANCH:
20+
description: 'Boolean value to identify if this is running on the main branch or not'
21+
required: true
22+
1923
runs:
2024
using: 'composite'
2125
steps:
2226
- name: Prepare the app
2327
uses: ./.github/actions/provision
2428

25-
- name: Extract branch name
26-
shell: bash
27-
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
28-
id: extract_branch
29-
3029
- name: Setup Expo and EAS
3130
uses: expo/expo-github-action@v8
3231
with:
@@ -53,7 +52,7 @@ runs:
5352
id: simulator_build
5453
run: |
5554
cd apps/mobile
56-
if [[ "$BRANCH_NAME" == "dev" ]]
55+
if [[ "$IS_MAIN_BRANCH" == "true" ]]
5756
then
5857
# No wait on simulator version build of the app if we are on a dev branch
5958
eas build --platform ios --profile=simulator-dev --non-interactive --no-wait
@@ -80,10 +79,10 @@ runs:
8079
shell: bash
8180
env:
8281
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ inputs.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
83-
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
82+
IS_MAIN_BRANCH: ${{ inputs.IS_MAIN_BRANCH }}
8483

8584
- name: Publish simulator expo link in PR
86-
if: ${{ steps.extract_branch.outputs.branch != 'dev' }}
85+
if: ${{ inputs.IS_MAIN_BRANCH == 'false' }}
8786
uses: actions/github-script@v7
8887
env:
8988
BUILD_LINK: ${{ steps.simulator_build.outputs.BUILD_LINK }}
@@ -101,7 +100,7 @@ runs:
101100
}
102101
103102
- name: 🛫 Build for production 🛫
104-
if: ${{ steps.extract_branch.outputs.branch == 'dev' }}
103+
if: ${{ inputs.IS_MAIN_BRANCH == 'true' }}
105104
run: |
106105
cd apps/mobile
107106
# Release version of the app, we should wait for it to see the result
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Trigger mobile preview builds for iOS and Android on main branch
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
deploy-eas-ios-dev:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: ./.github/actions/eas-deploy-ios
17+
with:
18+
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
19+
APPLE_ID: ${{ secrets.APPLE_ID }}
20+
ASC_APP_ID: ${{ secrets.ASC_APP_ID }}
21+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
22+
LEATHER_BOT: ${{ secrets.LEATHER_BOT }}
23+
IS_MAIN_BRANCH: true
24+
25+
deploy-eas-android-dev:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: ./.github/actions/eas-deploy-android
30+
with:
31+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
32+
LEATHER_BOT: ${{ secrets.LEATHER_BOT }}
33+
IS_MAIN_BRANCH: true
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
name: Trigger mobile preview builds for iOS and Android
1+
name: Trigger mobile preview builds for iOS and Android in PRs
22
on:
33
pull_request:
44
types:
55
- synchronize
66
- labeled
7+
78
permissions:
89
contents: write
910
pull-requests: write
1011

1112
jobs:
12-
deploy-eas-ios:
13+
deploy-eas-ios-pr:
1314
if: contains(github.event.pull_request.labels.*.name, 'build:mobile:simulator')
1415
runs-on: ubuntu-latest
1516
steps:
@@ -21,9 +22,9 @@ jobs:
2122
ASC_APP_ID: ${{ secrets.ASC_APP_ID }}
2223
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
2324
LEATHER_BOT: ${{ secrets.LEATHER_BOT }}
24-
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
25+
IS_MAIN_BRANCH: false
2526

26-
deploy-eas-android:
27+
deploy-eas-android-pr:
2728
if: contains(github.event.pull_request.labels.*.name, 'build:mobile:simulator')
2829
runs-on: ubuntu-latest
2930
steps:
@@ -32,5 +33,4 @@ jobs:
3233
with:
3334
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
3435
LEATHER_BOT: ${{ secrets.LEATHER_BOT }}
35-
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON_B64 }}
36-
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
36+
IS_MAIN_BRANCH: false

0 commit comments

Comments
 (0)