-
Notifications
You must be signed in to change notification settings - Fork 2k
160 lines (133 loc) Β· 4.63 KB
/
build-ios-development.yml
File metadata and controls
160 lines (133 loc) Β· 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: π± Build iOS for development
on:
push:
branches:
- "**"
paths:
- "apps/mobile/web-app/**"
- "apps/mobile/native/**"
- "apps/mobile/package.json"
- "apps/mobile/app.config.ts"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-runner:
runs-on: ubuntu-latest
outputs:
runner-label: ${{ steps.set-runner.outputs.runner-label }}
steps:
- name: Set runner
id: set-runner
run: |
runners=$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUNNER_GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runners")
available=$(echo "$runners" | jq '.runners[]? | select(.status == "online" and .busy == false and .labels[] .name == "macOS")')
if [ -n "$available" ]; then
echo "runner-label=self-hosted" >> $GITHUB_OUTPUT
else
echo "runner-label=macos-latest" >> $GITHUB_OUTPUT
fi
build-ipa-device-self-hosted:
name: Build iOS IPA for device (self-hosted)
if: github.secret_source != 'None' && needs.check-runner.outputs.runner-label == 'self-hosted'
needs: check-runner
runs-on: [self-hosted, macOS]
steps:
- name: π¦ Checkout code
uses: actions/checkout@v6
- name: π± Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: pnpm install
- name: π¨ Build iOS IPA
working-directory: apps/mobile
run: eas build --platform ios --profile development --non-interactive --local --output=./build.ipa
env:
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
CI: true
# Optional: Upload artifact
- name: π€ Upload IPA
uses: actions/upload-artifact@v7
with:
name: app-ios-development-device
path: apps/mobile/build.ipa
retention-days: 90
- name: Clear Xcode cache
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData
build-ipa-device-github:
name: Build iOS IPA for device (GitHub-hosted)
if: github.secret_source != 'None' && needs.check-runner.outputs.runner-label == 'macos-latest'
needs: check-runner
runs-on: macos-latest
steps:
- name: π¦ Checkout code
uses: actions/checkout@v6
- name: π§ Setup Xcode
uses: ./.github/actions/setup-xcode
- name: π¦ Setup pnpm
uses: pnpm/action-setup@v4
- name: π Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: "pnpm"
- name: π± Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: pnpm install
- name: π¨ Build iOS IPA
working-directory: apps/mobile
run: eas build --platform ios --profile development --non-interactive --local --output=./build.ipa
env:
CI: true
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
# Optional: Upload artifact
- name: π€ Upload IPA
uses: actions/upload-artifact@v7
with:
name: app-ios-development-device
path: apps/mobile/build.ipa
retention-days: 90
build-simulator:
name: Build iOS IPA for simulator
if: github.secret_source != 'None'
runs-on: macos-latest
steps:
- name: π¦ Checkout code
uses: actions/checkout@v6
- name: π§ Setup Xcode
uses: ./.github/actions/setup-xcode
- name: π¦ Setup pnpm
uses: pnpm/action-setup@v4
- name: π Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: "pnpm"
- name: π± Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: pnpm install
- name: π¨ Build iOS IPA
working-directory: apps/mobile
run: eas build --platform ios --profile ios-simulator --non-interactive --local --output=./build-simulator.ipa
env:
CI: true
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
# Optional: Upload artifact
- name: π€ Upload IPA
uses: actions/upload-artifact@v7
with:
name: app-ios-development-simulator
path: apps/mobile/build-simulator.ipa
retention-days: 90