Skip to content

Commit de9b6be

Browse files
committed
Add build workflow
1 parent 4a7bca9 commit de9b6be

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: CI
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
7+
branches: [main]
8+
env:
9+
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
610

711
jobs:
812
spell-check:
@@ -33,3 +37,58 @@ jobs:
3337

3438
- name: Run Biome
3539
run: biome ci .
40+
41+
build:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v5
46+
47+
- name: Setup java
48+
uses: actions/setup-java@v4
49+
with:
50+
distribution: "adopt" # See 'Supported distributions' for available options
51+
java-version: "21"
52+
53+
# - name: Workaround for "Build-tool 33.0.0 is missing DX at ..." error
54+
# run: |
55+
# ln -s $ANDROID_SDK_ROOT/build-tools/33.0.0/d8 $ANDROID_SDK_ROOT/build-tools/33.0.0/dx
56+
# ln -s $ANDROID_SDK_ROOT/build-tools/33.0.0/lib/d8.jar $ANDROID_SDK_ROOT/build-tools/33.0.0/lib/dx.jar
57+
58+
- name: Add android sdk tools to path
59+
run: |
60+
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
61+
export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/
62+
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator/
63+
64+
- name: Setup NodeJS
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: 20.x
68+
69+
- name: Install cordova
70+
run: npm install -g cordova
71+
72+
- name: Install yarn
73+
run: npm install -g yarn
74+
75+
- name: Setup project, install app plugins and deps
76+
run: yarn setup
77+
78+
- name: Configure the platform
79+
run: yarn clean
80+
81+
- name: Build Android prod
82+
run: yarn build android paid prod
83+
84+
- name: Sign apk
85+
run: |
86+
apksigner="$(find $ANDROID_SDK_ROOT/build-tools -name apksigner | sort -r | head -n 1)"
87+
${apksigner} sign --ks public.jks --ks-key-alias public --ks-pass pass:public --key-pass pass:public --in ./platforms/android/app/build/outputs/apk/release/*.apk --out ./platforms/android/app/build/outputs/apk/release/app-release-signed.apk
88+
89+
- name: Upload apk
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: app-release-signed
93+
path: ./platforms/android/app/build/outputs/apk/release/app-release-signed.apk
94+
if-no-files-found: error

public.jks

2.49 KB
Binary file not shown.

0 commit comments

Comments
 (0)