Skip to content

Commit

Permalink
chore: bump client api (AppFlowy-IO#4112)
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy authored and LucasXu0 committed Dec 8, 2023
1 parent 4405b59 commit ebd4d1d
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 57 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/build_android_apk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build AppFlowy Release APK

on: workflow_dispatch

env:
FLUTTER_VERSION: "3.13.9"
RUST_TOOLCHAIN: "1.70"

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:
channel: "stable"
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
path: frontend/appflowy_flutter/build/app/outputs/flutter-apk/
2 changes: 2 additions & 0 deletions frontend/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ TARGET_OS = "android"
CRATE_TYPE = "cdylib"
FLUTTER_OUTPUT_DIR = "Debug"
LIB_EXT = "so"
PRODUCT_EXT = "apk"
FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite,openssl_vendored"

[env.production-android]
BUILD_FLAG = "release"
TARGET_OS = "android"
CRATE_TYPE = "cdylib"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "apk"
LIB_EXT = "so"

[tasks.echo_env]
Expand Down
3 changes: 3 additions & 0 deletions frontend/appflowy_flutter/android/app/src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.10.0)

project(AppFlowy)

message(CONFIGURE_LOG "NDK PATH: ${ANDROID_NDK}")
message(CONFIGURE_LOG "Copying libc++_shared.so")

# arm64-v8a
file(COPY
${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so
Expand Down
54 changes: 36 additions & 18 deletions frontend/appflowy_tauri/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions frontend/appflowy_tauri/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ custom-protocol = ["tauri/custom-protocol"]
# Run the script:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ee31a680b5789b8c7c5397e6eadd4dd7739526f9" }
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "9da5cfb1d6fe843616e3652b2528f6e2b1afaccf" }
# Please use the following script to update collab.
# Working directory: frontend
#
Expand All @@ -67,14 +67,14 @@ client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "ee3
# To switch to the local path, run:
# scripts/tool/update_collab_source.sh
# ⚠️⚠️⚠️️
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "cc044fb676598a521e2fa7bf34fe58cdbc228cb8" }
collab = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-folder = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-document = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-database = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-plugins = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-user = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }
collab-persistence = { git = "https://github.com/AppFlowy-IO/AppFlowy-Collab", rev = "32218f1b6a9b09a9bbaa1835749e016246c092d4" }



Expand Down
Loading

0 comments on commit ebd4d1d

Please sign in to comment.