2023-12-08 07:49:06 +00:00
|
|
|
name: Build AppFlowy Release APK
|
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
env:
|
2023-12-27 03:11:14 +00:00
|
|
|
FLUTTER_VERSION: "3.18.0-0.2.pre"
|
2023-12-29 17:22:06 +00:00
|
|
|
RUST_TOOLCHAIN: "1.75"
|
2023-12-08 07:49:06 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: aarch64-linux-android
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
# the following step is required to avoid running out of space
|
|
|
|
- name: Maximize build space
|
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
sudo rm -rf /opt/ghc
|
|
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
|
|
|
|
|
|
- name: Checkout source code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
id: rust_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
- name: Install flutter
|
|
|
|
id: flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
2023-12-27 03:11:14 +00:00
|
|
|
channel: "beta"
|
2023-12-08 07:49:06 +00:00
|
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
|
|
cache: true
|
|
|
|
|
|
|
|
- uses: nttld/setup-ndk@v1
|
|
|
|
id: setup-ndk
|
|
|
|
with:
|
|
|
|
ndk-version: "r24"
|
|
|
|
add-to-path: true
|
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
prefix-key: ${{ matrix.os }}
|
|
|
|
workspaces: |
|
|
|
|
frontend/rust-lib
|
|
|
|
|
|
|
|
- uses: davidB/rust-cargo-make@v1
|
|
|
|
with:
|
|
|
|
version: "0.36.6"
|
|
|
|
|
|
|
|
- name: Install prerequisites
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
|
|
|
rustup target install aarch64-linux-android
|
|
|
|
rustup target install x86_64-linux-android
|
|
|
|
cargo install --force duckscript_cli
|
|
|
|
cargo install cargo-ndk
|
|
|
|
if [ "$RUNNER_OS" == "Linux" ]; then
|
|
|
|
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
|
|
|
|
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
|
|
|
|
sudo apt-get install keybinder-3.0 libnotify-dev
|
|
|
|
sudo apt-get install gcc-multilib
|
|
|
|
elif [ "$RUNNER_OS" == "Windows" ]; then
|
|
|
|
vcpkg integrate install
|
|
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
|
|
|
echo 'do nothing'
|
|
|
|
fi
|
|
|
|
cargo make appflowy-flutter-deps-tools
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Build AppFlowy
|
|
|
|
working-directory: frontend
|
|
|
|
env:
|
|
|
|
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
|
|
run: |
|
|
|
|
cargo make --profile production-android appflowy-android
|
|
|
|
|
|
|
|
- name: Upload APK
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: app-arm64-v8a-release.apk
|
2024-01-16 06:13:40 +00:00
|
|
|
path: frontend/appflowy_flutter/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
|