-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (79 loc) · 3.42 KB
/
main.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
on:
pull_request:
branches:
- master
- dev
push:
branches:
- master
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3
with:
lfs: true
submodules: "recursive"
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: get build tools version
id: build_tools_version
run: |
echo "version=$(ls /usr/local/lib/android/sdk/build-tools/ | head -1)" >> $GITHUB_OUTPUT
ls /usr/local/lib/android/sdk/build-tools/ | head -1
- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: yarn
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: yarn install
- name: create build directory
run: mkdir build
- name: 🚀 Build aab
run: NODE_OPTIONS=--max_old_space_size=4096 eas build --local --non-interactive --platform android --profile aab --output build/${{ steps.vars.outputs.sha_short }}.aab
- name: 🚀 Build app (android production)
run: eas build --local --non-interactive --platform android --profile production --output build/${{ steps.vars.outputs.sha_short }}.production.apk
- name: change app id (dev)
run: find ./ -path ./.git -prune -o -path ./node_modules -prune -o -path ./assets -prune -o -path ./.github -prune -o -type f -exec sed -i 's/me.wcyat.safecantoneseai/me.wcyat.safecantoneseaidev/g' {} \;
- name: allow internet (dev)
run: sed -i '/<uses-permission android:name="android.permission.INTERNET" tools:node="remove"\/>/d' android/app/src/main/AndroidManifest.xml
- name: 🚀 Build app (android development)
run: eas build --local --non-interactive --platform android --profile development --output build/${{ steps.vars.outputs.sha_short }}.development.apk
- name: add models to apks
run: |
zip -ur build/${{ steps.vars.outputs.sha_short }}.production.apk assets/models/*.bin
zip -ur build/${{ steps.vars.outputs.sha_short }}.development.apk assets/models/*.bin
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
# ID used to access action output
id: sign_app
with:
releaseDirectory: build/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: ${{ steps.build_tools_version.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: android production apk
path: build/${{ steps.vars.outputs.sha_short }}.production-signed.apk # or path/to/artifact
- uses: actions/upload-artifact@v4
with:
name: android development apk
path: build/${{ steps.vars.outputs.sha_short }}.development-signed.apk # or path/to/artifact
- uses: actions/upload-artifact@v4
with:
name: android app bundle
path: build/${{ steps.vars.outputs.sha_short }}.aab # or path/to/artifact