-
Notifications
You must be signed in to change notification settings - Fork 6
175 lines (146 loc) · 5.09 KB
/
Copy pathmobile.yml
File metadata and controls
175 lines (146 loc) · 5.09 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Mobile
on:
push:
branches: [main]
paths:
- 'apps/mobile/**'
- '.github/workflows/mobile.yml'
- '.nvmrc'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
pull_request:
paths:
- 'apps/mobile/**'
- '.github/workflows/mobile.yml'
- '.nvmrc'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
# EAS cloud builds / store submits are manual so they don't burn build
# credits on every push. Trigger from the Actions tab → "Run workflow".
workflow_dispatch:
inputs:
platform:
description: 'EAS build platform'
type: choice
options: [android, ios, all]
default: android
profile:
description: 'EAS build profile (see apps/mobile/eas.json)'
type: choice
options: [preview, production, development]
default: preview
submit:
description: 'Submit the build to the store after it finishes'
type: boolean
default: false
permissions:
contents: read
defaults:
run:
working-directory: apps/mobile
jobs:
# Fast, free check on every push/PR: typecheck, lint, test, and prove both JS
# bundles build via `expo export` (no device, no EAS minutes).
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install
working-directory: .
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm typecheck
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Bundle (expo export)
run: pnpm export
# Produce a standalone, installable companion-app APK without consuming EAS build
# credits. The native project remains generated output and is not committed.
android-apk:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
cache: pnpm
- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '17'
- name: Set up Android SDK
uses: android-actions/setup-android@v4
with:
log-accepted-android-sdk-licenses: false
packages: 'platform-tools platforms;android-36 build-tools;36.0.0 ndk;27.1.12297006'
- name: Install
working-directory: .
run: pnpm install --frozen-lockfile
- name: Generate Android project
run: pnpm exec expo prebuild --platform android --clean --no-install
# Expo/RN debuggable variants omit the embedded JS bundle and require a
# Metro server. Release embeds the bundle; Expo's generated project signs
# it with the debug keystore, making it installable but not store-ready.
- name: Build standalone APK
run: ./android/gradlew --no-daemon --stacktrace -p android :app:assembleRelease
- name: Upload standalone APK
uses: actions/upload-artifact@v4
with:
name: tronbrowser-android-preview-${{ github.sha }}
path: apps/mobile/android/app/build/outputs/apk/release/app-release.apk
if-no-files-found: error
overwrite: true
retention-days: 14
- name: Add artifact instructions
run: |
{
echo '### TronBrowser Android preview APK'
echo
echo 'Download the `tronbrowser-android-preview-*` artifact from this workflow run.'
echo 'After extracting it, install with `adb install -r app-release.apk`.'
} >> "$GITHUB_STEP_SUMMARY"
# Cloud build + optional store submit via EAS. Requires the EXPO_TOKEN repo
# secret (Expo account access token). iOS/Android signing credentials are
# managed by EAS (`eas credentials`) — not stored here.
eas-build:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install
working-directory: .
run: pnpm install --frozen-lockfile
- uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Validate EAS request
run: |
if [[ '${{ inputs.submit }}' == 'true' && '${{ inputs.profile }}' != 'production' ]]; then
echo '::error::Store submission requires the production build profile.'
exit 1
fi
- name: EAS build
run: eas build --platform ${{ inputs.platform }} --profile ${{ inputs.profile }} --non-interactive
- name: EAS submit
if: ${{ inputs.submit }}
run: eas submit --platform ${{ inputs.platform }} --profile production --non-interactive --latest