-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (140 loc) · 4.43 KB
/
app-ci.yml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: App CI/CD
on:
push:
branches: ["main", "develop", "testnet", "lw-*"]
pull_request:
branches: ["main", "develop", "testnet"]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
APP_STORE_CONNECT_KEY: ${{ secrets.APPLE_API_KEY }}
ACCOUNT_KEY: ${{ secrets.GOOGLE_PLAY_ACCOUNT_JSON }}
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
jobs:
checks:
name: Checks
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun lint
continue-on-error: true
- name: Prettier
run: bun format:check
continue-on-error: true
- name: TypeScript Compile
run: bun compile
continue-on-error: true
- name: Expo Doctor
run: bun doctor
continue-on-error: true
- name: Bundle JS Code
run: bun export
continue-on-error: true
- name: Check Version Code
run: ./scripts/check-version-code.sh
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop'
build-and-deploy-ios:
name: Build & Deploy iOS
needs: checks
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Git LFS pull
run: git lfs pull
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{env.EXPO_TOKEN}}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Write App Store Connect Key to file
run: 'echo "$APP_STORE_CONNECT_KEY" > app-store-connect-key.json'
shell: bash
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Build Production iOS App
if: github.ref == 'refs/heads/main'
run: bun build:ios:production
- name: Deploy Production iOS App
if: github.ref == 'refs/heads/main'
run: bun deploy:ios:production
- name: Build Staging iOS App
if: github.ref == 'refs/heads/develop'
run: bun build:ios:staging
- name: Deploy Staging iOS App
if: github.ref == 'refs/heads/develop'
run: bun deploy:ios:staging
- name: Store iOS Artifact
uses: actions/upload-artifact@v4
with:
name: ios-artifact
path: ios-binary.ipa
build-and-deploy-android:
name: Build & Deploy Android
needs: checks
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{env.EXPO_TOKEN}}
- name: Write Google Service file
run: 'echo "$ACCOUNT_KEY" > services-api-key.json'
shell: bash
- name: Build Production Android App
if: github.ref == 'refs/heads/main'
run: bun build:android:production
- name: Deploy Production Android App
if: github.ref == 'refs/heads/main'
run: bun deploy:android:production
- name: Build Staging Android App
if: github.ref == 'refs/heads/develop'
run: bun build:android:staging
- name: Deploy Staging Android App
if: github.ref == 'refs/heads/develop'
run: bun deploy:android:staging
- name: Store Android Artifact
uses: actions/upload-artifact@v4
with:
name: android-artifact
path: android-binary.aab