Skip to content

Commit

Permalink
Updated android apk build action
Browse files Browse the repository at this point in the history
  • Loading branch information
albbus-stack committed May 24, 2024
1 parent bd13f2a commit b78cc46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- uses: nttld/setup-ndk@v1
id: ndk
with:
ndk-version: r26d

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -41,6 +46,8 @@ jobs:
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

- name: Install Cargo Mobile CLI & init
env:
NDK_HOME: ${{ steps.ndk.outputs.ndk-path }}
run: cargo install --git https://github.com/tauri-apps/cargo-mobile2 && cargo mobile init

- name: Install Bun
Expand All @@ -64,6 +71,8 @@ jobs:
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

- name: Build
env:
NDK_HOME: ${{ steps.ndk.outputs.ndk-path }}
run: mv Cargo.toml Cargo.toml.bak && cp Cargo.mobile.toml Cargo.toml && cargo android apk build --release --split-per-abi

- name: Sign APKs with keystore
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ rustc-link-lib = ["libpq"]

> Works only with `openssl` installed with the `vendored` option (requires `perl` of the UNIX flavour to build it).
- You have to create a `.cargo/config.toml` file in the project folder with the following content to setup the linker for the Android targets:
- You have to run `cargo mobile init` to generate only the `.cargo/config.toml` file and discard the other changes. If that errors out just create it with the following content to setup the linker for the Android targets:

```toml
[target.aarch64-linux-android]
Expand Down

0 comments on commit b78cc46

Please sign in to comment.