Skip to content

Commit

Permalink
add android build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
derdilla committed Apr 25, 2024
1 parent c5cabc8 commit edf108b
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/calc-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and release calculator for Android
on:
workflow_dispatch:

jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
cmake \
curl \
gcc-multilib \
git \
g++ \
g++-multilib \
libappindicator3-dev \
libasound2-dev \
libc6-dev \
libclang-10-dev \
libclang-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
llvm-10-dev \
llvm-dev \
nasm \
ninja-build \
openjdk-11-jdk-headless \
pkg-config \
tree \
wget
- uses: actions/checkout@v4
- name: Install flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.16.3
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: "r26b"
add-to-path: true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: 1.75
components: "rustfmt"

- uses: Swatinem/rust-cache@v2
with:
prefix-key: rustdesk-lib-cache-android
key: aarch64-linux-android

- name: Build
env:
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
working-directory: ./apps/calculator
run: |
rustup target add aarch64-linux-android
flutter pub get
flutter build apk --debug --target-platform android-arm64 --split-per-abi
- uses: actions/upload-artifact@v4
with:
path: "apps/calculator/build/app/outputs/apk/debug/*.apk"
compression-level: 2
1 change: 1 addition & 0 deletions apps/calculator/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class _MyAppState extends State<MyApp> {
// TODO:
// - keyboard type
// - clear history
// - app info
},
),
],
Expand Down

0 comments on commit edf108b

Please sign in to comment.