Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
Fix/windows build (#1641)
vedonc932f63e571c
diff --git a/.github/workflows/appflowy_editor_test.yml b/.github/workflows/appflowy_editor_test.ymlindex 5a729ebe88..d298140594 100644--- a/.github/workflows/appflowy_editor_test.yml+++ b/.github/workflows/appflowy_editor_test.yml@@ -15,6 +15,7 @@ on:env:CARGO_TERM_COLOR: always+ FLUTTER_VERSION: "3.3.9"jobs:tests:@@ -30,7 +31,7 @@ jobs:- uses: subosito/flutter-action@v2with:channel: "stable"- flutter-version: "3.3.9"+ flutter-version: ${{ env.FLUTTER_VERSION }}cache: true- name: Run FlowyEditor testsdiff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yamldeleted file mode 100644index d5486c0b63..0000000000--- a/.github/workflows/ci.yaml+++ /dev/null@@ -1,100 +0,0 @@-name: CI--on:- push:- branches:- - "main"- - "release/*"-- pull_request:- branches:- - "main"- - "release/*"--jobs:- build:- strategy:- matrix:- os: [ubuntu-latest, macos-latest, windows-latest]- include:- - os: ubuntu-latest- flutter_profile: development-linux-x86_64- - os: macos-latest- flutter_profile: development-mac-x86_64- - os: windows-latest- flutter_profile: development-windows-x86- runs-on: ${{ matrix.os }}-- steps:- - uses: actions/checkout@v2-- - id: rust_toolchain- uses: actions-rs/toolchain@v1- with:- toolchain: "stable-2022-04-07"-- - id: flutter- uses: subosito/flutter-action@v2- with:- channel: "stable"- cache: true- flutter-version: "3.3.9"-- - name: Cache Cargo- id: cache-cargo- uses: actions/cache@v2- with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Cache Rust- uses: actions/cache@v2- with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Setup Environment- run: |- 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 libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev- sudo apt-get install keybinder-3.0- elif [ "$RUNNER_OS" == "Windows" ]; then- vcpkg integrate install- elif [ "$RUNNER_OS" == "macOS" ]; then- echo 'do nothing'- fi- shell: bash-- - if: steps.cache-cargo.outputs.cache-hit != 'true'- name: Deps- working-directory: frontend- run: |- cargo install cargo-make- cargo install duckscript_cli-- - name: Cargo make appflowy-deps-tools- working-directory: frontend- run: |- cargo make appflowy-deps-tools-- - name: Config Flutter- run: |- if [ "$RUNNER_OS" == "Linux" ]; then- flutter config --enable-linux-desktop- elif [ "$RUNNER_OS" == "macOS" ]; then- flutter config --enable-macos-desktop- elif [ "$RUNNER_OS" == "Windows" ]; then- flutter config --enable-windows-desktop- fi- shell: bash-- - name: Build- working-directory: frontend- run: |- cargo make --profile ${{ matrix.flutter_profile }} appflowy-devdiff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.ymldeleted file mode 100644index 7a9e4a0490..0000000000--- a/.github/workflows/dart_lint.yml+++ /dev/null@@ -1,86 +0,0 @@-# This workflow uses actions that are not certified by GitHub.-# They are provided by a third-party and are governed by-# separate terms of service, privacy policy, and support-# documentation.--name: Flutter lint--on:- push:- branches:- - "main"- - "release/*"- paths:- - "frontend/app_flowy/**"-- pull_request:- branches:- - "main"- - "release/*"- paths:- - "frontend/app_flowy/**"--env:- CARGO_TERM_COLOR: always--jobs:- flutter-analyze:- name: flutter analyze- runs-on: ubuntu-latest- steps:- - name: Checkout- uses: actions/checkout@v2- - uses: subosito/flutter-action@v1- with:- flutter-version: "3.3.9"- channel: "stable"- - uses: actions-rs/toolchain@v1- with:- toolchain: "stable-2022-04-07"-- - name: Cache Cargo- id: cache-cargo- uses: actions/cache@v2- with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Cache Rust- id: cache-rust-target- uses: actions/cache@v2- with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - if: steps.cache-cargo.outputs.cache-hit != 'true'- name: Rust Deps- working-directory: frontend- run: |- cargo install cargo-make-- - name: Cargo make flowy dev- working-directory: frontend- run: |- cargo make appflowy-deps-tools-- - name: Flutter Deps- run: flutter packages pub get- working-directory: frontend/app_flowy-- - name: Build FlowySDK- working-directory: frontend- run: |- cargo make --profile development-linux-x86_64 appflowy-sdk-dev-- - name: Flutter Code Generation- working-directory: frontend/app_flowy- run: |- flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json- flutter packages pub run build_runner build --delete-conflicting-outputs-- - name: Run Flutter Analyzer- working-directory: frontend/app_flowy- run: flutter analyzediff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.ymldeleted file mode 100644index 978ebe4696..0000000000--- a/.github/workflows/dart_test.yml+++ /dev/null@@ -1,80 +0,0 @@-name: Frontend test--on:- push:- branches:- - "main"- - "release/*"- paths:- - "frontend/app_flowy/**"-- pull_request:- branches:- - "main"- - "release/*"- paths:- - "frontend/app_flowy/**"--env:- CARGO_TERM_COLOR: always--jobs:- tests:- runs-on: ubuntu-latest- steps:- - uses: actions/checkout@v2- - uses: actions-rs/toolchain@v1- with:- toolchain: "stable-2022-04-07"-- - uses: subosito/flutter-action@v2- with:- channel: "stable"- flutter-version: "3.3.9"- cache: true-- - name: Cache Cargo- uses: actions/cache@v2- with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Cache Rust- id: cache-rust-target- uses: actions/cache@v2- with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - if: steps.cache-cargo.outputs.cache-hit != 'true'- name: Rust Deps- working-directory: frontend- run: |- cargo install cargo-make- cargo make appflowy-deps-tools-- - name: Flutter Deps- working-directory: frontend/app_flowy- run: |- flutter config --enable-linux-desktop-- - name: Build Test lib- working-directory: frontend- run: |- cargo make --profile test-linux build-test-lib-- - name: Flutter Code Generation- working-directory: frontend/app_flowy- run: |- flutter packages pub get- flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json- flutter packages pub run build_runner build --delete-conflicting-outputs-- - name: Run bloc tests- working-directory: frontend/app_flowy- run: |- flutter pub get- flutter testdiff --git a/.github/workflows/integration_test.yml b/.github/workflows/flutter_ci.yamlsimilarity index 54%rename from .github/workflows/integration_test.ymlrename to .github/workflows/flutter_ci.yamlindex 5ba7714e28..674e3a54c9 100644--- a/.github/workflows/integration_test.yml+++ b/.github/workflows/flutter_ci.yaml@@ -1,4 +1,4 @@-name: integration test+name: Flutter-CIon:push:@@ -6,56 +6,68 @@ on:- "main"- "release/*"paths:- - "frontend/app_flowy/**"+ - "frontend/**"pull_request:branches:- "main"- "release/*"paths:- - "frontend/app_flowy/**"+ - "frontend/**"env:- CARGO_TERM_COLOR: always+ FLUTTER_VERSION: "3.3.9"+ RUST_TOOLCHAIN: "1.65"jobs:- tests:+ build:strategy:+ fail-fast: falsematrix:- os: [macos-latest]-+ job:+ - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest,}+ - { target: x86_64-apple-darwin, os: macos-latest, }+ - { target: x86_64-pc-windows-msvc, os: windows-latest, }+ include:+ - os: ubuntu-latest+ flutter_profile: development-linux-x86_64+ - os: macos-latest+ flutter_profile: development-mac-x86_64+ - os: windows-latest+ flutter_profile: development-windows-x86runs-on: ${{ matrix.os }}steps:- - uses: actions/checkout@v2- - uses: actions-rs/toolchain@v1- with:- toolchain: "stable-2022-04-07"+ - name: Checkout source code+ uses: actions/checkout@v2- - uses: subosito/flutter-action@v2+ - name: Install Rust toolchain+ id: rust_toolchain+ uses: actions-rs/toolchain@v1+ with:+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ target: ${{ matrix.job.target }}+ override: true+ components: rustfmt+ profile: minimal++ - name: Install flutter+ id: flutter+ uses: subosito/flutter-action@v2with:channel: "stable"- flutter-version: "3.3.9"+ flutter-version: ${{ env.FLUTTER_VERSION }}cache: true- - name: Cache Cargo- uses: actions/cache@v2+ - uses: Swatinem/rust-cache@v2with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}+ prefix-key: ${{ matrix.job.os }}- - name: Cache Rust- id: cache-rust-target- uses: actions/cache@v2- with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Setup Environment+ - name: Install prerequisites+ working-directory: frontendrun: |+ cargo install --force cargo-make+ cargo install --force duckscript_cliif [ "$RUNNER_OS" == "Linux" ]; thensudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pubsudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list@@ -64,31 +76,12 @@ jobs:sudo apt-get install keybinder-3.0elif [ "$RUNNER_OS" == "Windows" ]; thenvcpkg integrate install- cargo install --force duckscript_clielif [ "$RUNNER_OS" == "macOS" ]; thenecho 'do nothing'fishell: bash- - if: steps.cache-cargo.outputs.cache-hit != 'true'- name: Rust Deps- working-directory: frontend- run: |- cargo install cargo-make- cargo make appflowy-deps-tools-- - name: Build Test lib- working-directory: frontend- run: |- if [ "$RUNNER_OS" == "Linux" ]; then- cargo make --profile production-linux-x86_64 appflowy- elif [ "$RUNNER_OS" == "macOS" ]; then- cargo make --profile production-mac-x86_64 appflowy- elif [ "$RUNNER_OS" == "Windows" ]; then- cargo make --profile production-windows-x86 appflowy- fi-- - name: Config Flutter+ - name: Enable Flutter Desktoprun: |if [ "$RUNNER_OS" == "Linux" ]; thenflutter config --enable-linux-desktop@@ -99,14 +92,30 @@ jobs:fishell: bash- - name: Flutter Code Generation+ - name: Build AppFlowy+ working-directory: frontend+ run: |+ cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev++ - name: Flutter Analyzer+ working-directory: frontend/app_flowy+ run: flutter analyze++ #Just run one platform+ - if: $RUNNER_OS" == "Linux"+ name: Build Flutter unit test lib+ working-directory: frontend+ run: |+ cargo make build-test-lib++ - if: $RUNNER_OS" == "Linux"+ name: Run Flutter unit testsworking-directory: frontend/app_flowyrun: |- flutter packages pub get- flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json- flutter packages pub run build_runner build --delete-conflicting-outputs+ flutter pub get+ flutter test- - name: Run AppFlowy tests+ - name: Run Flutter integration testsworking-directory: frontend/app_flowyrun: |if [ "$RUNNER_OS" == "Linux" ]; then@@ -119,10 +128,9 @@ jobs:shell: bash- uses: codecov/codecov-action@v3- with:+ with:name: appflowyflags: appflowyenv_vars: ${{ matrix.os }}fail_ci_if_error: trueverbose: true-diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 72aadb4383..dffdcf3312 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -5,6 +5,10 @@ on:tags:- '*'+env:+ FLUTTER_VERSION: "3.3.9"+ RUST_TOOLCHAIN: "1.65"+jobs:create-release:runs-on: ubuntu-latest@@ -31,221 +35,161 @@ jobs:release_name: v${{ github.ref }}body_path: ${{ env.RELEASE_NOTES_PATH }}- build-linux-x86:- runs-on: ubuntu-latest+ build-for-windows:+ name: ${{ matrix.job.target }} (${{ matrix.job.os }})needs: create-releaseenv:- LINUX_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/linux/Release- LINUX_ZIP_NAME: AppFlowy-linux-x86.tar.gz- LINUX_PACKAGE_NAME: AppFlowy_${{ github.ref_name }}_linux-amd64.deb+ WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows+ WINDOWS_ZIP_NAME: AppFlowy_${{ github.ref_name }}_windows-x86_64.zip+ WINDOWS_INSTALLER_NAME: AppFlowy_${{ github.ref_name }}_windows-x86_64+ runs-on: ${{ matrix.job.os }}+ strategy:+ fail-fast: false+ matrix:+ job:+ - { target: x86_64-pc-windows-msvc, os: windows-2019 }steps:- - name: Checkout- uses: actions/checkout@v2+ - name: Checkout source code+ uses: actions/checkout@v3++ - name: Install flutter+ uses: subosito/flutter-action@v2+ with:+ channel: "stable"+ flutter-version: ${{ env.FLUTTER_VERSION }}+ cache: true- - name: Setup environment - Rust and Cargo+ - name: Install Rust toolchainuses: actions-rs/toolchain@v1with:- toolchain: 'stable-2022-04-07'+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ target: ${{ matrix.job.target }}+ override: true+ components: rustfmt+ profile: minimal- - name: Setup environment - Flutter- uses: subosito/flutter-action@v2+ - uses: Swatinem/rust-cache@v2with:- channel: 'stable'- flutter-version: '3.3.9'+ prefix-key: ${{ matrix.job.os }}- - name: Pre build+ - name: Install prerequisitesworking-directory: frontendrun: |- sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub- sudo apt-get update- sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev- sudo apt-get install keybinder-3.0- source $HOME/.cargo/envcargo install --force cargo-makecargo install --force duckscript_cli- cargo make appflowy-deps-tools- - name: Build Linux app+ - name: Build Windows appworking-directory: frontendrun: |- flutter config --enable-linux-desktop- cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86_64 appflowy+ flutter config --enable-windows-desktop+ cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy- - name: Configuring Linux Package+ - name: Archive Asset+ uses: vimtor/action-zip@v1+ with:+ files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\+ dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}++ - name: Copy installer config & icon fileworking-directory: frontendrun: |- mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/opt- mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/usr/share/applications- cp -r ./scripts/linux_installer ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN- cd ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN- grep -rl "\[CHANGE_THIS\]" ./control | xargs sed -i "s/\[CHANGE_THIS\]/${{ github.ref_name }}/"- chmod 0755 {postinst,postrm}+ cp scripts/windows_installer/* ../${{ env.WINDOWS_APP_RELEASE_PATH }}- - name: Build Linux package- working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}+ - name: Build installer executable+ working-directory: ${{ env.WINDOWS_APP_RELEASE_PATH }}run: |- mv AppFlowy package/opt/- cd package-- # Update Exec & icon path in desktop entry- grep -rl "\[CHANGE_THIS\]" ./opt/AppFlowy/appflowy.desktop.temp | xargs sed -i "s/\[CHANGE_THIS\]/\/opt/"- # Add desktop entry in package- mv ./opt/AppFlowy/appflowy.desktop.temp ./usr/share/applications/appflowy.desktop-- # Build- cd ../ && dpkg-deb --build --root-owner-group -Z xz package ${{ env.LINUX_PACKAGE_NAME }}+ iscc /F${{ env.WINDOWS_INSTALLER_NAME }} inno_setup_config.iss /DAppVersion=${{ github.ref_name }}- - name: Upload Release Asset+ - name: Upload Assetid: upload-release-assetuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_ZIP_NAME }}- asset_name: ${{ env.LINUX_ZIP_NAME }}+ asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}+ asset_name: ${{ env.WINDOWS_ZIP_NAME }}asset_content_type: application/octet-stream- - name: Upload Release Asset Install Package- id: upload-release-asset-install-package+ - name: Upload Installer Asset+ id: upload-installer-assetuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_NAME }}- asset_name: ${{ env.LINUX_PACKAGE_NAME }}+ asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\Output\${{ env.WINDOWS_INSTALLER_NAME }}.exe+ asset_name: ${{ env.WINDOWS_INSTALLER_NAME }}.exeasset_content_type: application/octet-stream- build-linux-x86-alt:- runs-on: ubuntu-18.04+ build-for-macOS:+ name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}]+ runs-on: ${{ matrix.job.os }}needs: create-releaseenv:- LINUX_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/linux/Release- LINUX_PACKAGE_NAME: AppFlowy_${{ github.ref_name }}_linux-amd64-alt.deb+ MACOS_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/macos/Release+ MACOS_X86_ZIP_NAME: AppFlowy_${{ github.ref_name }}_macos-x86_64.zip+ MACOS_DMG_NAME: AppFlowy_${{ github.ref_name }}_macos-x86_64+ strategy:+ fail-fast: false+ matrix:+ job:+ - { target: x86_64-apple-darwin, os: macos-10.15, extra-build-args: "" }steps:- - name: Checkout- uses: actions/checkout@v2-- - name: Setup environment - Rust and Cargo- uses: actions-rs/toolchain@v1- with:- toolchain: 'stable-2022-04-07'+ - name: Checkout source code+ uses: actions/checkout@v3- - name: Setup environment - Flutter+ - name: Install flutteruses: subosito/flutter-action@v2with:- channel: 'stable'- flutter-version: '3.3.9'+ channel: "stable"+ flutter-version: ${{ env.FLUTTER_VERSION }}+ cache: true- - name: Pre build- working-directory: frontend- run: |- sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub- sudo apt-get update- sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev- sudo apt-get install keybinder-3.0- source $HOME/.cargo/env- cargo install --force cargo-make- cargo install --force duckscript_cli- cargo make appflowy-deps-tools-- - name: Build Linux app- working-directory: frontend- run: |- flutter config --enable-linux-desktop- cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86_64 appflowy-- - name: Configuring Linux Package- working-directory: frontend- run: |- mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/opt- mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/usr/share/applications- cp -r ./scripts/linux_installer ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN- cd ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN- grep -rl "\[CHANGE_THIS\]" ./control | xargs sed -i "s/\[CHANGE_THIS\]/${{ github.ref_name }}/"- chmod 0755 {postinst,postrm}-- - name: Build Linux package- working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}- run: |- mv AppFlowy package/opt/- cd package-- # Update Exec & icon path in desktop entry- grep -rl "\[CHANGE_THIS\]" ./opt/AppFlowy/appflowy.desktop.temp | xargs sed -i "s/\[CHANGE_THIS\]/\/opt/"- # Add desktop entry in package- mv ./opt/AppFlowy/appflowy.desktop.temp ./usr/share/applications/appflowy.desktop-- # Build- cd ../ && dpkg-deb --build --root-owner-group -Z xz package ${{ env.LINUX_PACKAGE_NAME }}-- - name: Upload Alternative Release Asset Install Package- id: upload-release-asset-install-package- uses: actions/upload-release-asset@v1- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- with:- upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_NAME }}- asset_name: ${{ env.LINUX_PACKAGE_NAME }}- asset_content_type: application/octet-stream-- build-macos-x86_64:- runs-on: macos-latest- needs: create-release- env:- MACOS_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/macos/Release- MACOS_X86_ZIP_NAME: Appflowy-macos-x86_64.zip- MACOS_DMG_NAME: Appflowy-macos-x86_64-installer- steps:- - name: Checkout- uses: actions/checkout@v2-- - name: Setup environment - Rust and Cargo+ - name: Install Rust toolchainuses: actions-rs/toolchain@v1with:- toolchain: 'stable-2022-04-07'+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ target: ${{ matrix.job.target }}+ override: true+ components: rustfmt+ profile: minimal- - name: Setup environment - Flutter- uses: subosito/flutter-action@v2+ - uses: Swatinem/rust-cache@v2with:- channel: 'stable'- flutter-version: '3.3.9'+ prefix-key: ${{ matrix.job.os }}- - name: Pre build+ - name: Install prerequisitesworking-directory: frontendrun: |- source $HOME/.cargo/envcargo install --force cargo-makecargo install --force duckscript_cli- cargo make appflowy-deps-tools- - name: Build macOS app for x86_64+ - name: Build AppFlowyworking-directory: frontendrun: |flutter config --enable-macos-desktopcargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86_64 appflowy- - name: Create MacOS dmg+ - name: Create macOS dmgrun: |- brew install create-dmg- create-dmg \- --volname ${{ env.MACOS_DMG_NAME }} \- --hide-extension "AppFlowy.app" \- --background frontend/scripts/dmg_assets/AppFlowyInstallerBackground.jpg \- --window-size 600 450 \- --icon-size 94 \- --icon "AppFlowy.app" 141 249 \- --app-drop-link 458 249 \- "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \- "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app"-- - name: Archive macOS app+ brew install create-dmg+ create-dmg \+ --volname ${{ env.MACOS_DMG_NAME }} \+ --hide-extension "AppFlowy.app" \+ --background frontend/scripts/dmg_assets/AppFlowyInstallerBackground.jpg \+ --window-size 600 450 \+ --icon-size 94 \+ --icon "AppFlowy.app" 141 249 \+ --app-drop-link 458 249 \+ "${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg" \+ "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app"++ - name: Archive Assetworking-directory: ${{ env.MACOS_APP_RELEASE_PATH }}run: zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app- - name: Upload Release Asset+ - name: Upload Assetuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}@@ -254,85 +198,144 @@ jobs:asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}asset_name: ${{ env.MACOS_X86_ZIP_NAME }}asset_content_type: application/octet-stream- - name: Upload DMG Release Asset++ - name: Upload DMG Assetuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:- upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg- asset_name: ${{ env.MACOS_DMG_NAME }}.dmg- asset_content_type: application/octet-stream+ upload_url: ${{ needs.create-release.outputs.upload_url }}+ asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg+ asset_name: ${{ env.MACOS_DMG_NAME }}.dmg+ asset_content_type: application/octet-stream- build-windows-x86_64:- runs-on: windows-latest+ build-for-linux:+ name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}]+ runs-on: ${{ matrix.job.os }}needs: create-releaseenv:- WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows- WINDOWS_ZIP_NAME: AppFlowy-windows-x86_64.zip- WINDOWS_INSTALLER_NAME: AppFlowy-${{ github.ref_name }}-windows-x86_64+ 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+ 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: "", }steps:- - name: Checkout+ - name: Checkout source codeuses: actions/checkout@v3- - name: Setup environment - Rust and Cargo+ - name: Install flutter+ uses: subosito/flutter-action@v2+ with:+ channel: "stable"+ flutter-version: ${{ env.FLUTTER_VERSION }}+ cache: true++ - name: Install Rust toolchainuses: actions-rs/toolchain@v1with:- toolchain: 'stable-2022-04-07'+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ target: ${{ matrix.job.target }}+ override: true+ components: rustfmt+ profile: minimal- - name: Setup environment - Flutter- uses: subosito/flutter-action@v2+ - uses: Swatinem/rust-cache@v2with:- channel: 'stable'- flutter-version: '3.3.9'+ prefix-key: ${{ matrix.job.os }}- - name: Pre build+ - name: Install prerequisitesworking-directory: frontendrun: |- vcpkg integrate install+ sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub+ sudo apt-get update+ sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev+ sudo apt-get install keybinder-3.0+ source $HOME/.cargo/envcargo install --force cargo-makecargo install --force duckscript_cli- cargo make appflowy-deps-tools- - name: Build Windows app+ - name: Build AppFlowyworking-directory: frontendrun: |- flutter config --enable-windows-desktop- cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy+ flutter config --enable-linux-desktop+ cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86_64 appflowy- - uses: vimtor/action-zip@v1- with:- files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\- dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}-- - name: Copy installer config & icon file+ - name: Archive Assert+ working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}+ run: tar -czf ${{ env.LINUX_ZIP_NAME }} *++ - name: Configuring Linux Packageworking-directory: frontendrun: |- cp scripts/windows_installer/* ../${{ env.WINDOWS_APP_RELEASE_PATH }}+ mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/opt+ mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/usr/share/applications+ cp -r ./scripts/linux_installer ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN+ cd ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN+ grep -rl "\[CHANGE_THIS\]" ./control | xargs sed -i "s/\[CHANGE_THIS\]/${{ github.ref_name }}/"+ chmod 0755 {postinst,postrm}- - name: Build installer executable- working-directory: ${{ env.WINDOWS_APP_RELEASE_PATH }}+ - name: Build Linux package+ working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}run: |- iscc /F${{ env.WINDOWS_INSTALLER_NAME }} inno_setup_config.iss /DAppVersion=${{ github.ref_name }}+ mv AppFlowy package/opt/+ cd package++ # Update Exec & icon path in desktop entry+ grep -rl "\[CHANGE_THIS\]" ./opt/AppFlowy/appflowy.desktop.temp | xargs sed -i "s/\[CHANGE_THIS\]/\/opt/"+ # Add desktop entry in package+ mv ./opt/AppFlowy/appflowy.desktop.temp ./usr/share/applications/appflowy.desktop++ # Build+ cd ../ && dpkg-deb --build --root-owner-group -Z xz package ${{ env.LINUX_PACKAGE_NAME }}- - name: Upload Release Asset+ - name: Upload Assetid: upload-release-assetuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }}- asset_name: ${{ env.WINDOWS_ZIP_NAME }}+ asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_ZIP_NAME }}+ asset_name: ${{ env.LINUX_ZIP_NAME }}asset_content_type: application/octet-stream- - name: Upload Installer Asset- id: upload-installer-asset+ - name: Upload Asset Install Package+ id: upload-release-asset-install-packageuses: actions/upload-release-asset@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:upload_url: ${{ needs.create-release.outputs.upload_url }}- asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\Output\${{ env.WINDOWS_INSTALLER_NAME }}.exe- asset_name: ${{ env.WINDOWS_INSTALLER_NAME }}.exe+ asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_NAME }}+ asset_name: ${{ env.LINUX_PACKAGE_NAME }}asset_content_type: application/octet-stream++# build-for-docker:+# runs-on: ubuntu-latest+# steps:+# - name: Checkout+# uses: actions/checkout@v2+#+# - name: Login to Docker Hub+# uses: docker/login-action@v1+# with:+# username: ${{ secrets.DOCKER_HUB_USERNAME }}+# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}+#+# - name: Set up Docker Buildx+# uses: docker/setup-buildx-action@v1+#+# - name: Build and push+# uses: docker/build-push-action@v2+# with:+# context: .+# file: ./frontend/scripts/docker-buildfiles/Dockerfile+# builder: ${{ steps.buildx.outputs.name }}+# push: true+# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/appflowy_client:${{ github.ref_name }}+# cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache+# cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache,mode=maxdiff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.ymldeleted file mode 100644index 5c64195ef3..0000000000--- a/.github/workflows/release_docker.yml+++ /dev/null@@ -1,35 +0,0 @@-name: release_docker--on:- push:- branches:- - 'main'- tags:- - '*'--jobs:- build-docker-image:- runs-on: ubuntu-latest- steps:- - name: Checkout- uses: actions/checkout@v2-- - name: Login to Docker Hub- uses: docker/login-action@v1- with:- username: ${{ secrets.DOCKER_HUB_USERNAME }}- password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}-- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v1-- - name: Build and push- uses: docker/build-push-action@v2- with:- context: .- file: ./frontend/scripts/docker-buildfiles/Dockerfile- builder: ${{ steps.buildx.outputs.name }}- push: true- tags: ${{ secrets.DOCKER_HUB_USERNAME }}/appflowy_client:${{ github.ref_name }}- cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache- cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache,mode=maxdiff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yamlnew file mode 100644index 0000000000..d5f57aca64--- /dev/null+++ b/.github/workflows/rust_ci.yaml@@ -0,0 +1,74 @@+name: Rust-CI++on:+ push:+ branches:+ - "main"+ - "release/*"+ paths:+ - "frontend/rust-lib/**"+ - "shared-lib/**"++ pull_request:+ branches:+ - "main"+ - "release/*"+ paths:+ - "frontend/rust-lib/**"+ - "shared-lib/**"++env:+ CARGO_TERM_COLOR: always+ RUST_TOOLCHAIN: "1.65"++jobs:+ test-on-ubuntu:+ runs-on: ubuntu-latest+ steps:+ - name: Install Rust toolchain+ id: rust_toolchain+ uses: actions-rs/toolchain@v1+ with:+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ override: true+ components: rustfmt, clippy+ profile: minimal++ - name: Install prerequisites+ working-directory: frontend+ run: |+ cargo install --force cargo-make+ cargo install --force duckscript_cli++ - uses: Swatinem/rust-cache@v2+ with:+ prefix-key: ${{ matrix.job.os }}++ - name: Build FlowySDK+ working-directory: frontend+ run: |+ cargo make --profile development-linux-x86_64 appflowy-sdk-dev++ - name: rustfmt rust-lib+ run: cargo fmt --all -- --check+ working-directory: frontend/rust-lib/++ - name: clippy rust-lib+ run: cargo clippy --no-default-features+ working-directory: frontend/rust-lib++ - name: Run rust-lib tests+ working-directory: frontend/rust-lib+ run: RUST_LOG=info cargo test --no-default-features --features="sync"++ - name: rustfmt shared-lib+ run: cargo fmt --all -- --check+ working-directory: shared-lib++ - name: clippy shared-lib+ run: cargo clippy --no-default-features+ working-directory: shared-lib++ - name: Run shared-lib tests+ working-directory: shared-lib+ run: RUST_LOG=info cargo test --no-default-featuresdiff --git a/.github/workflows/rust_coverage.yml b/.github/workflows/rust_coverage.ymlindex 578368ac15..c98c3d0a4d 100644--- a/.github/workflows/rust_coverage.yml+++ b/.github/workflows/rust_coverage.yml@@ -11,52 +11,45 @@ on:env:CARGO_TERM_COLOR: always+ FLUTTER_VERSION: "3.3.9"+ RUST_TOOLCHAIN: "1.65"jobs:tests:runs-on: ubuntu-lateststeps:- - name: Checkout- uses: actions/checkout@v2-- - id: rust_toolchain+ - name: Install Rust toolchain+ id: rust_toolchainuses: actions-rs/toolchain@v1with:- toolchain: 'stable-2022-04-07'-- - name: Cache Cargo- uses: actions/cache@v2- with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}+ toolchain: ${{ env.RUST_TOOLCHAIN }}+ target: ${{ matrix.job.target }}+ override: true+ profile: minimal- - name: Cache Rust- uses: actions/cache@v2+ - name: Install flutter+ id: flutter+ uses: subosito/flutter-action@v2with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-+ channel: "stable"+ flutter-version: ${{ env.FLUTTER_VERSION }}+ cache: true- - name: Install cargo-make+ - name: Install prerequisitesworking-directory: frontendrun: |- cargo install cargo-make+ cargo install --force cargo-make+ cargo install --force duckscript_cli- - name: Setup environment - Flutter- uses: subosito/flutter-action@v2+ - uses: Swatinem/rust-cache@v2with:- channel: 'stable'- flutter-version: '3.3.9'+ prefix-key: ${{ matrix.job.os }}- name: Install code-coverage toolsworking-directory: frontendrun: |sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pubsudo apt-get update- sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-devsudo apt-get install keybinder-3.0cargo install grcovrustup component add llvm-tools-previewdiff --git a/.github/workflows/rust_lint.yml b/.github/workflows/rust_lint.ymldeleted file mode 100644index f7e20647d1..0000000000--- a/.github/workflows/rust_lint.yml+++ /dev/null@@ -1,61 +0,0 @@-name: Rust lint--on:- push:- branches:- - "main"- - "release/*"- paths:- - "frontend/rust-lib/**"- - "shared-lib/**"-- pull_request:- branches:- - "main"- - "release/*"- paths:- - "frontend/rust-lib/**"- - "shared-lib/**"--env:- CARGO_TERM_COLOR: always--jobs:- rust-fmt:- name: Rustfmt- runs-on: ubuntu-latest- steps:- - uses: actions/checkout@v2- - uses: actions-rs/toolchain@v1- with:- toolchain: 'stable-2022-04-07'- override: true- - uses: subosito/flutter-action@v1- with:- flutter-version: '3.3.9'- channel: "stable"-- - name: Rust Deps- working-directory: frontend- run: |- cargo install cargo-make- cargo make appflowy-deps-tools-- - name: Build FlowySDK- working-directory: frontend- run: |- cargo make --profile development-linux-x86_64 appflowy-sdk-dev-- - run: rustup component add rustfmt- working-directory: frontend/rust-lib- - name: rustfmt- run: cargo fmt --all -- --check- working-directory: frontend/rust-lib/--- - run: rustup component add clippy- working-directory: frontend/rust-lib- - name: clippy- run: cargo clippy --no-default-features- working-directory: frontend/rust-lib-diff --git a/.github/workflows/rust_test.yml b/.github/workflows/rust_test.ymldeleted file mode 100644index 3f49d5085b..0000000000--- a/.github/workflows/rust_test.yml+++ /dev/null@@ -1,60 +0,0 @@-name: Backend test--on:- push:- branches:- - "main"- - "release/*"- paths:- - "frontend/rust-lib/**"- - "shared-lib/**"-- pull_request:- branches:- - "main"- - "release/*"- paths:- - "frontend/rust-lib/**"- - "shared-lib/**"--env:- CARGO_TERM_COLOR: always--jobs:- tests:- runs-on: ubuntu-latest- steps:- - name: Checkout- uses: actions/checkout@v2-- - id: rust_toolchain- uses: actions-rs/toolchain@v1- with:- toolchain: 'stable-2022-04-07'-- - name: Cache Cargo- uses: actions/cache@v2- with:- path: |- ~/.cargo- key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Cache Rust- uses: actions/cache@v2- with:- path: |- frontend/rust-lib/target- shared-lib/target- key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}-- - name: Install cargo-make- working-directory: frontend- run: cargo install cargo-make-- - name: Run rust-lib tests- working-directory: frontend/rust-lib- run: RUST_LOG=info cargo test --no-default-features --features="sync"-- - name: Run shared-lib tests- working-directory: shared-lib- run: RUST_LOG=info cargo test --no-default-features