Skip to content

Commit 9e97947

Browse files
This commit adds a new GitHub Actions workflow to automatically build the Android APK for the frontend application.
The workflow is triggered on push to the main branch and can also be run manually. It performs the following steps: - Sets up the Node.js and Java environment. - Installs project dependencies. - Builds the Android APK using Expo Application Services (EAS). - Uploads the generated APK as a build artifact. An `eas.json` configuration file has also been added to the frontend project.
1 parent 4b7a0c3 commit 9e97947

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build Android APK
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
env:
12+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: 'temurin'
27+
java-version: '17'
28+
29+
- name: Install Expo CLI
30+
run: npm install -g eas-cli
31+
32+
- name: Install dependencies
33+
run: npm install
34+
working-directory: ./frontend
35+
36+
- name: Build and Download APK
37+
run: |
38+
URL=$(eas build --platform android --profile production --non-interactive --wait --output=./app.apk)
39+
echo "APK URL: $URL"
40+
working-directory: ./frontend
41+
42+
- name: Upload APK
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: app
46+
path: frontend/app.apk

frontend/eas.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"cli": {
3+
"version": ">= 7.6.0"
4+
},
5+
"build": {
6+
"development": {
7+
"developmentClient": true,
8+
"distribution": "internal"
9+
},
10+
"preview": {
11+
"distribution": "internal"
12+
},
13+
"production": {}
14+
},
15+
"submit": {
16+
"production": {}
17+
}
18+
}

0 commit comments

Comments
 (0)