Skip to content

Commit 28ae8ba

Browse files
author
Rafał Mikrut
authored
Experimental Android port (qarmin#1821)
1 parent 433fc5c commit 28ae8ba

93 files changed

Lines changed: 12060 additions & 448 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/android.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: 🤖 Android APK
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-apk:
12+
name: Build Android APK
13+
runs-on: ubuntu-latest
14+
env:
15+
NDK_VERSION: 26.3.11579264
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Java (required by Android SDK)
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: temurin
25+
java-version: '17'
26+
27+
- name: Set up Android SDK
28+
uses: android-actions/setup-android@v3
29+
30+
- name: Cache Android SDK
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
${{ env.ANDROID_SDK_ROOT }}/cmdline-tools
35+
${{ env.ANDROID_SDK_ROOT }}/ndk
36+
${{ env.ANDROID_SDK_ROOT }}/platforms
37+
${{ env.ANDROID_SDK_ROOT }}/platform-tools
38+
${{ env.ANDROID_SDK_ROOT }}/build-tools
39+
key: ${{ runner.os }}-android-sdk-${{ env.NDK_VERSION }}
40+
restore-keys: |
41+
${{ runner.os }}-android-sdk-
42+
43+
- name: Install Android NDK and tools
44+
run: |
45+
rustup target add aarch64-linux-android
46+
cargo install cargo-apk || true
47+
48+
yes | sdkmanager --install "ndk;${NDK_VERSION}"
49+
echo "ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/${NDK_VERSION}" >> $GITHUB_ENV
50+
51+
- name: Cache Cargo
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
~/.cargo/registry
56+
~/.cargo/git
57+
target
58+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-android-v1
59+
restore-keys: |
60+
${{ runner.os }}-cargo-
61+
62+
- name: Generate keystores
63+
run: |
64+
sudo apt update || true
65+
sudo apt install -y just
66+
67+
just gen_keystores
68+
69+
- name: Build APK (release)
70+
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
71+
run: |
72+
echo "VERS=release" >> $GITHUB_ENV
73+
cargo apk build -p cedinia --lib --release
74+
mv target/release/apk/cedinia.apk cedinia.apk
75+
76+
- name: Build APK (debug)
77+
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
78+
run: |
79+
echo "VERS=debug" >> $GITHUB_ENV
80+
cargo apk build -p cedinia --lib
81+
mv target/debug/apk/cedinia.apk cedinia.apk
82+
83+
- name: Upload APK artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: cedinia-${{ env.VERS }}
87+
path: cedinia.apk
88+
89+
- name: Release
90+
uses: softprops/action-gh-release@v2
91+
if: ${{ github.ref == 'refs/heads/master' && vars.HAVE_PAT_REPOSITORY_TOKEN == '1' }}
92+
with:
93+
tag_name: "Nightly"
94+
files: |
95+
cedinia.apk
96+
token: ${{ secrets.PAT_REPOSITORY }}

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Quality
1+
name: 🧹 Quality
22
on:
33
push:
44
pull_request:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ TestFiles
3333
charts*
3434
*__pycache__*/
3535
result
36-
.direnv
36+
.direnv
37+
cedinia/android/keystore/*.keystore
38+
cedinia/docs

0 commit comments

Comments
 (0)