Parcourir la source

ci: support aarch64 (#1710)

vedon il y a 2 ans
Parent
commit
ba653ff463

+ 19 - 6
.github/workflows/release.yml

@@ -70,11 +70,13 @@ jobs:
 
       - uses: Swatinem/rust-cache@v2
         with:
-          prefix-key: ${{ matrix.job.os }}
+          prefix-key: appflowy-lib-cache
+          key: ${{ matrix.job.os }}-${{ matrix.job.target }}
 
       - name: Install prerequisites
         working-directory: frontend
         run: |
+          vcpkg integrate install
           cargo install --force cargo-make
           cargo install --force duckscript_cli
 
@@ -157,7 +159,8 @@ jobs:
 
       - uses: Swatinem/rust-cache@v2
         with:
-          prefix-key: ${{ matrix.job.os }}
+          prefix-key: appflowy-lib-cache
+          key: ${{ matrix.job.os }}-${{ matrix.job.target }}
 
       - name: Install prerequisites
         working-directory: frontend
@@ -217,12 +220,14 @@ jobs:
       LINUX_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/linux/Release
       LINUX_ZIP_NAME: AppFlowy_${{ matrix.job.target }}_${{ matrix.job.os }}.tar.gz
       LINUX_PACKAGE_NAME: AppFlowy_${{ github.ref_name }}_${{ matrix.job.os }}.deb
+      # PKG_CONFIG_SYSROOT_DIR: /
     strategy:
       fail-fast: false
       matrix:
         job:
-          - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", }
-          - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-18.04, extra-build-args: "", }
+          - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-x86_64 }
+          # - { arch: aarch64, target: aarch64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-aarch64 }
+          - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-18.04, extra-build-args: "", flutter_profile: production-linux-x86_64}
     steps:
       - name: Checkout source code
         uses: actions/checkout@v3
@@ -245,7 +250,8 @@ jobs:
 
       - uses: Swatinem/rust-cache@v2
         with:
-          prefix-key: ${{ matrix.job.os }}
+          prefix-key: appflowy-lib-cache
+          key: ${{ matrix.job.os }}-${{ matrix.job.target }}
 
       - name: Install prerequisites
         working-directory: frontend
@@ -257,12 +263,19 @@ jobs:
           source $HOME/.cargo/env
           cargo install --force cargo-make
           cargo install --force duckscript_cli
+          rustup target add ${{ matrix.job.target }}
+
+      - name: Install gcc-aarch64-linux-gnu
+        if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
+        working-directory: frontend
+        run: |
+          sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
 
       - name: Build AppFlowy
         working-directory: frontend
         run: |
           flutter config --enable-linux-desktop
-          cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86_64 appflowy
+          cargo make --env APP_VERSION=${{ github.ref_name }} --profile ${{ matrix.job.flutter_profile}} appflowy
 
       - name: Archive Assert
         working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}

+ 4 - 2
frontend/Makefile.toml

@@ -132,6 +132,7 @@ CRATE_TYPE = "cdylib"
 FLUTTER_OUTPUT_DIR = "Debug"
 LIB_EXT = "so"
 LINUX_ARCH = "arm64"
+FLUTTER_DESKTOP_FEATURES = "flutter,rev-sqlite,openssl_vendored"
 
 [env.production-linux-aarch64]
 BUILD_FLAG = "release"
@@ -142,6 +143,7 @@ FLUTTER_OUTPUT_DIR = "Release"
 LIB_EXT = "so"
 LINUX_ARCH = "arm64"
 APP_ENVIRONMENT = "production"
+FLUTTER_DESKTOP_FEATURES = "flutter,rev-sqlite,openssl_vendored"
 
 [tasks.echo_env]
 script = ['''
@@ -169,14 +171,14 @@ BUILD_FLAG = "debug"
 TARGET_OS = "android"
 CRATE_TYPE = "cdylib"
 FLUTTER_OUTPUT_DIR = "Debug"
-FEATURES = "flutter,openssl_vendored"
+FLUTTER_DESKTOP_FEATURES = "flutter,rev-sqlite,openssl_vendored"
 
 [env.production-android]
 BUILD_FLAG = "release"
 TARGET_OS = "android"
 CRATE_TYPE = "cdylib"
 FLUTTER_OUTPUT_DIR = "Release"
-FEATURES = "flutter,openssl_vendored"
+FLUTTER_DESKTOP_FEATURES = "flutter,rev-sqlite,openssl_vendored"
 
 [tasks.setup-crate-type]
 private = true

Fichier diff supprimé car celui-ci est trop grand
+ 313 - 166
frontend/rust-lib/Cargo.lock


+ 3 - 2
frontend/rust-lib/flowy-database/Cargo.toml

@@ -16,7 +16,8 @@ r2d2 = "0.8.9"
 libsqlite3-sys = { version = ">=0.8.0, <0.24.0", features = ["bundled"] }
 scheduled-thread-pool = "0.2.5"
 error-chain = "=0.12.0"
-openssl = { version = "0.10.38", optional = true }
+openssl = { version = "0.10.38", optional = true, features = ["vendored"] }
+openssl-sys = { version = "0.9.69", optional = true, features = ["vendored"] }
 
 [features]
-openssl_vendored = ["openssl/vendored"]
+openssl_vendored = ["openssl", "openssl-sys"]

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff