Skip to content

Commit 840a54d

Browse files
committed
Updated docs on android apk release builds
1 parent 3098186 commit 840a54d

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

.github/workflows/android.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,50 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- name: Checkout code
17+
- name: Checkout code
1818
uses: actions/checkout@v4
1919

2020
- name: Setup Rust
2121
uses: actions-rs/toolchain@v1
2222
with:
2323
profile: minimal
2424
toolchain: stable
25+
target: wasm32-unknown-unknown
26+
override: true
2527

2628
- name: Cache Rust dependencies
2729
uses: Swatinem/rust-cache@v2
2830

31+
- name: Install Bun
32+
uses: oven-sh/setup-bun@v1
33+
with:
34+
bun-version: latest
35+
36+
- name: Install Bun dependencies
37+
run: bun install --frozen-lockfile
38+
39+
- name: Generate TailwindCSS
40+
run: bun build:tailwind
41+
42+
- name: Install Dioxus CLI
43+
run: cargo install dioxus-cli
44+
45+
- name: Create .env file
46+
env:
47+
API_URL: ${{ secrets.API_URL }}
48+
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
49+
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }}
50+
SUPABASE_JWT_SECRET: ${{ secrets.SUPABASE_JWT_SECRET }}
51+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
52+
run: printf "API_URL=$API_URL\nSUPABASE_URL=$SUPABASE_URL\nSUPABASE_API_KEY=$SUPABASE_API_KEY\nSUPABASE_JWT_SECRET=$SUPABASE_JWT_SECRET\nDATABASE_URL=$DATABASE_URL\n" > .env
53+
54+
# TODO: Sign the APKs using a keystore
55+
2956
- name: Build
3057
run: mv Cargo.toml Cargo.toml.bak && cp Cargo.mobile.toml Cargo.toml && cargo android apk build --release --split-per-abi
3158

3259
- name: Upload artifact
3360
uses: actions/upload-artifact@v4
3461
with:
3562
name: apk
36-
path: target/aarch64-linux-android/release/t5-rs-desktop
63+
path: gen/android/app/build/outputs/apk/**/*.apk

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ dist/
2424
Cargo.toml.bak
2525

2626
# Env
27-
.env
27+
.env
28+
29+
# Android signing
30+
*.keystore

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ strip = true
150150
incremental = false
151151
```
152152

153-
- If you want to use Github Actions to deploy the app you should add the following secrets in the repository settings:
153+
- If you want to use Github Actions to deploy the app (API, Web & Desktop) you should add the following secrets in the repository settings:
154154

155155
```text
156156
API_URL (for the web app) -> update this after your API deployment
@@ -182,3 +182,20 @@ DATABASE_URL
182182
- For Windows you can configure the `.github/workflows/windows.yaml` workflow to build and upload the `.msi` installer in the action artifacts on every push to the `master` branch or manually with the `workflow_dispatch` event.
183183
- For Linux you can configure the `.github/workflows/linux.yaml` workflow to build and upload the `.deb` package along with the dist folder in the action artifacts on every push to the `master` branch or manually with the `workflow_dispatch` event.
184184
- Currently `dx bundle` is being actively developed and is not yet ready for production use, so you should use `dx build` if bundling fails on other platforms (this is not good since you need attach the entire `dist` folder to your release build).
185+
186+
### Android
187+
188+
- You can build the Android app using the `bun build:android` command, this will generate various `.apk` files in the `gen/android/app/build/outputs/apk/` subfolders for each ABI.
189+
- Generate a keystore file using the `keytool` CLI as follows:
190+
191+
```sh
192+
keytool -genkey -keystore release-key.keystore -alias alias_name -keyalg RSA -validity 10000
193+
```
194+
195+
- You can then sign each generated `.apk` file using the `jarsigner` CLI as follows:
196+
197+
```sh
198+
jarsigner -keystore release-key.keystore ./path/to/apk alias_name
199+
```
200+
201+
- After signing an `.apk` you can install the app on your device physically or using `adb install ./path/to/apk` (you should sign and install an `.apk` compatible with the ABI of your device).

gen/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33
<uses-permission android:name="android.permission.INTERNET" />
44

5-
<application android:hasCode="true" android:supportsRtl="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme">
5+
<application android:hasCode="true" android:supportsRtl="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" android:extractNativeLibs="true">
66

77
<activity android:configChanges="orientation|keyboardHidden" android:exported="true" android:screenOrientation="portrait" android:label="@string/app_name" android:name="com.example.t5_rs.MainActivity">
88
<meta-data android:name="android.app.lib_name" android:value="t5_rs" />

0 commit comments

Comments
 (0)