From d23e07bd0d717da4f31affe17b9a6e99496b4a44 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 8 Apr 2024 14:40:57 +0800 Subject: [PATCH] ci: isolate ci test --- .github/workflows/android_ci.yaml.bak | 126 ------ .github/workflows/build_bot.yaml | 28 -- .github/workflows/build_command.yml | 42 -- .github/workflows/commit_lint.yml | 11 - .github/workflows/docker_ci.yml | 51 --- .github/workflows/flutter_ci.yaml | 373 ----------------- .github/workflows/ios_ci.yaml | 92 ----- .github/workflows/release.yml | 495 ----------------------- .github/workflows/rust_ci.yaml | 19 +- .github/workflows/rust_coverage.yml | 61 --- .github/workflows/tauri2_ci.yaml | 113 ------ .github/workflows/tauri_ci.yaml | 114 ------ .github/workflows/tauri_release.yml | 153 ------- .github/workflows/translation_notify.yml | 18 - .github/workflows/web2_ci.yaml | 61 --- .github/workflows/web_ci.yaml | 83 ---- 16 files changed, 2 insertions(+), 1838 deletions(-) delete mode 100644 .github/workflows/android_ci.yaml.bak delete mode 100644 .github/workflows/build_bot.yaml delete mode 100644 .github/workflows/build_command.yml delete mode 100644 .github/workflows/commit_lint.yml delete mode 100644 .github/workflows/docker_ci.yml delete mode 100644 .github/workflows/flutter_ci.yaml delete mode 100644 .github/workflows/ios_ci.yaml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/rust_coverage.yml delete mode 100644 .github/workflows/tauri2_ci.yaml delete mode 100644 .github/workflows/tauri_ci.yaml delete mode 100644 .github/workflows/tauri_release.yml delete mode 100644 .github/workflows/translation_notify.yml delete mode 100644 .github/workflows/web2_ci.yaml delete mode 100644 .github/workflows/web_ci.yaml diff --git a/.github/workflows/android_ci.yaml.bak b/.github/workflows/android_ci.yaml.bak deleted file mode 100644 index b65ceec608..0000000000 --- a/.github/workflows/android_ci.yaml.bak +++ /dev/null @@ -1,126 +0,0 @@ -# name: Android CI - -# on: -# push: -# branches: -# - "main" -# paths: -# - ".github/workflows/mobile_ci.yaml" -# - "frontend/**" -# - "!frontend/appflowy_tauri/**" - -# pull_request: -# branches: -# - "main" -# paths: -# - ".github/workflows/mobile_ci.yaml" -# - "frontend/**" -# - "!frontend/appflowy_tauri/**" - -# env: -# CARGO_TERM_COLOR: always -# FLUTTER_VERSION: "3.19.0" -# RUST_TOOLCHAIN: "1.75" -# CARGO_MAKE_VERSION: "0.36.6" - -# concurrency: -# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} -# cancel-in-progress: true - -# jobs: -# build: -# if: github.event.pull_request.draft != true -# strategy: -# fail-fast: true -# matrix: -# os: [macos-14] -# runs-on: ${{ matrix.os }} - -# steps: -# - name: Check storage space -# run: df -h - -# # 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" -# sudo docker image prune --all --force -# sudo rm -rf /opt/hostedtoolcache/codeQL -# sudo rm -rf ${GITHUB_WORKSPACE}/.git -# sudo rm -rf $ANDROID_HOME/ndk - -# - name: Check storage space -# run: df -h - -# - name: Checkout source code -# uses: actions/checkout@v4 - -# - uses: actions/setup-java@v4 -# with: -# distribution: temurin -# java-version: 11 - -# - name: Install Rust toolchain -# id: rust_toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: ${{ env.RUST_TOOLCHAIN }} -# override: true -# profile: minimal - -# - name: Install flutter -# id: flutter -# uses: subosito/flutter-action@v2 -# with: -# channel: "stable" -# flutter-version: ${{ env.FLUTTER_VERSION }} - -# - uses: gradle/gradle-build-action@v3 -# with: -# gradle-version: 7.4.2 - -# - 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 -# run: | -# cargo make --profile development-android appflowy-android-dev-ci - - -# - name: Run integration tests -# # https://github.com/ReactiveCircus/android-emulator-runner -# uses: reactivecircus/android-emulator-runner@v2 -# with: -# api-level: 32 -# arch: arm64-v8a -# disk-size: 2048M -# working-directory: frontend/appflowy_flutter -# script: flutter test integration_test/runner.dart \ No newline at end of file diff --git a/.github/workflows/build_bot.yaml b/.github/workflows/build_bot.yaml deleted file mode 100644 index 65854b94d1..0000000000 --- a/.github/workflows/build_bot.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build Bot - -on: - issue_comment: - types: [created] - -jobs: - dispatch_slash_command: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - # get build name from pubspec.yaml - - name: Get build version - working-directory: frontend/appflowy_flutter - id: get_build_name - run: | - echo "fetching version from pubspec.yaml..." - echo "build_name=$(grep 'version: ' pubspec.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT - - - uses: peter-evans/slash-command-dispatch@v4 - with: - token: ${{ secrets.PAT }} - commands: build - static-args: | - ref=refs/pull/${{ github.event.issue.number }}/head - build_name=${{ steps.get_build_name.outputs.build_name }} diff --git a/.github/workflows/build_command.yml b/.github/workflows/build_command.yml deleted file mode 100644 index 1648953bae..0000000000 --- a/.github/workflows/build_command.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: build - -on: - repository_dispatch: - types: [build-command] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: notify appflowy_builder - run: | - platform=${{ github.event.client_payload.slash_command.args.unnamed.arg1 }} - build_name=${{ github.event.client_payload.slash_command.args.named.build_name }} - branch=${{ github.event.client_payload.slash_command.args.named.ref }} - build_type="" - arch="" - - if [ "$platform" = "android" ]; then - build_type="apk" - elif [ "$platform" = "macos" ]; then - arch="universal" - fi - - params=$(jq -n \ - --arg ref "main" \ - --arg repo "LucasXu0/AppFlowy" \ - --arg branch "$branch" \ - --arg build_name "$build_name" \ - --arg build_type "$build_type" \ - --arg arch "$arch" \ - '{ref: $ref, inputs: {repo: $repo, branch: $branch, build_name: $build_name, build_type: $build_type, arch: $arch}} | del(.inputs | .. | select(. == ""))') - - echo "params: $params" - - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/AppFlowy-IO/AppFlowy-Builder/actions/workflows/$platform.yaml/dispatches \ - -d "$params" diff --git a/.github/workflows/commit_lint.yml b/.github/workflows/commit_lint.yml deleted file mode 100644 index eb55922af2..0000000000 --- a/.github/workflows/commit_lint.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Commit messages lint -on: [pull_request, push] - -jobs: - commitlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v4 diff --git a/.github/workflows/docker_ci.yml b/.github/workflows/docker_ci.yml deleted file mode 100644 index 2c2143c1fe..0000000000 --- a/.github/workflows/docker_ci.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Docker-CI - -on: - push: - branches: - - main - - release/* - paths: - - frontend/** - pull_request: - branches: - - main - - release/* - paths: - - frontend/** - types: [opened, synchronize, reopened, unlocked, ready_for_review] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-app: - if: github.event.pull_request.draft != true - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Set up Docker Compose - run: | - docker-compose --version || { - echo "Docker Compose not found, installing..." - sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - docker-compose --version - } - - - name: Build the app - shell: bash - run: | - set -eu -o pipefail - cd frontend/scripts/docker-buildfiles - docker-compose build --no-cache --progress=plain \ - | while read line; do \ - if [[ "$line" =~ ^Step[[:space:]] ]]; then \ - echo "$(date -u '+%H:%M:%S') | $line"; \ - else \ - echo "$line"; \ - fi; \ - done diff --git a/.github/workflows/flutter_ci.yaml b/.github/workflows/flutter_ci.yaml deleted file mode 100644 index ffa1d309a5..0000000000 --- a/.github/workflows/flutter_ci.yaml +++ /dev/null @@ -1,373 +0,0 @@ -name: Flutter-CI - -on: - push: - branches: - - "main" - - "release/*" - paths: - - ".github/workflows/flutter_ci.yaml" - - ".github/actions/flutter_build/**" - - "frontend/rust-lib/**" - - "frontend/appflowy_flutter/**" - - "frontend/resources/**" - - pull_request: - branches: - - "main" - - "release/*" - paths: - - ".github/workflows/flutter_ci.yaml" - - ".github/actions/flutter_build/**" - - "frontend/rust-lib/**" - - "frontend/appflowy_flutter/**" - - "frontend/resources/**" - -env: - CARGO_TERM_COLOR: always - FLUTTER_VERSION: "3.19.0" - RUST_TOOLCHAIN: "1.75" - CARGO_MAKE_VERSION: "0.36.6" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - prepare-linux: - if: github.event.pull_request.draft != true - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - flutter_profile: development-linux-x86_64 - target: x86_64-unknown-linux-gnu - runs-on: ${{ matrix.os }} - - steps: - # the following step is required to avoid running out of space - - name: Maximize build space - 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@v4 - - - name: Flutter build - uses: ./.github/actions/flutter_build - with: - os: ${{ matrix.os }} - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} - flutter_profile: ${{ matrix.flutter_profile }} - - prepare-windows: - if: github.event.pull_request.draft != true - strategy: - fail-fast: true - matrix: - os: [windows-latest] - include: - - os: windows-latest - flutter_profile: development-windows-x86 - target: x86_64-pc-windows-msvc - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Flutter build - uses: ./.github/actions/flutter_build - with: - os: ${{ matrix.os }} - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} - flutter_profile: ${{ matrix.flutter_profile }} - - prepare-macos: - if: github.event.pull_request.draft != true - strategy: - fail-fast: true - matrix: - os: [macos-latest] - include: - - os: macos-latest - flutter_profile: development-mac-x86_64 - target: x86_64-apple-darwin - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Flutter build - uses: ./.github/actions/flutter_build - with: - os: ${{ matrix.os }} - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} - flutter_profile: ${{ matrix.flutter_profile }} - - unit_test: - needs: [prepare-linux] - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - flutter_profile: development-linux-x86_64 - target: x86_64-unknown-linux-gnu - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - 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: Swatinem/rust-cache@v2 - with: - prefix-key: ${{ matrix.os }} - workspaces: | - frontend/rust-lib - cache-all-crates: true - - - uses: taiki-e/install-action@v2 - with: - tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}, duckscript_cli - - - name: Install prerequisites - working-directory: frontend - 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 libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev - fi - shell: bash - - - name: Enable Flutter Desktop - 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 - git config --system core.longpaths true - flutter config --enable-windows-desktop - fi - shell: bash - - - uses: actions/download-artifact@v4 - with: - name: ${{ github.run_id }}-${{ matrix.os }} - - - name: Uncompress appflowy_flutter - run: tar -xf appflowy_flutter.tar.gz - - - name: Run flutter pub get - working-directory: frontend - run: cargo make pub_get - - - name: Run Flutter unit tests - working-directory: frontend - run: | - if [ "$RUNNER_OS" == "macOS" ]; then - cargo make dart_unit_test - elif [ "$RUNNER_OS" == "Linux" ]; then - cargo make dart_unit_test_no_build - elif [ "$RUNNER_OS" == "Windows" ]; then - cargo make dart_unit_test_no_build - fi - shell: bash - - cloud_integration_test: - needs: [prepare-linux] - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - flutter_profile: development-linux-x86_64 - target: x86_64-unknown-linux-gnu - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout appflowy cloud code - uses: actions/checkout@v4 - with: - repository: AppFlowy-IO/AppFlowy-Cloud - path: AppFlowy-Cloud - - - name: Prepare appflowy cloud env - working-directory: AppFlowy-Cloud - run: | - # log level - cp deploy.env .env - sed -i 's|RUST_LOG=.*|RUST_LOG=trace|' .env - sed -i 's/GOTRUE_EXTERNAL_GOOGLE_ENABLED=.*/GOTRUE_EXTERNAL_GOOGLE_ENABLED=true/' .env - sed -i 's|API_EXTERNAL_URL=.*|API_EXTERNAL_URL=http://localhost|' .env - - - name: Run Docker-Compose - working-directory: AppFlowy-Cloud - run: | - docker compose down -v --remove-orphans - docker compose pull - docker compose up -d - sleep 10 - - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install flutter - id: flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - cache: true - - - uses: taiki-e/install-action@v2 - with: - tool: cargo-make@${{ env.CARGO_MAKE_VERSION }} - - - name: Install prerequisites - 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 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 keybinder-3.0 libnotify-dev - shell: bash - - - name: Enable Flutter Desktop - run: | - flutter config --enable-linux-desktop - shell: bash - - - uses: actions/download-artifact@v4 - with: - name: ${{ github.run_id }}-${{ matrix.os }} - - - name: Uncompressed appflowy_flutter - run: | - tar -xf appflowy_flutter.tar.gz - ls -al - - - name: Run flutter pub get - working-directory: frontend - run: cargo make pub_get - - - name: Run Flutter integration tests - working-directory: frontend/appflowy_flutter - run: | - export DISPLAY=:99 - sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & - sudo apt-get install network-manager - docker ps -a - flutter test integration_test/cloud/cloud_runner.dart -d Linux --coverage - shell: bash - - # split the integration tests into different machines to minimize the time - integration_test_1: - needs: [prepare-linux] - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - target: 'x86_64-unknown-linux-gnu' - runs-on: ${{ matrix.os }} - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Flutter Integration Test 1 - uses: ./.github/actions/flutter_integration_test - with: - test_path: integration_test/desktop_runner_1.dart - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} - - integration_test_2: - needs: [prepare-linux] - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - target: 'x86_64-unknown-linux-gnu' - runs-on: ${{ matrix.os }} - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Flutter Integration Test 2 - uses: ./.github/actions/flutter_integration_test - with: - test_path: integration_test/desktop_runner_2.dart - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} - - integration_test_3: - needs: [prepare-linux] - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - include: - - os: ubuntu-latest - target: 'x86_64-unknown-linux-gnu' - runs-on: ${{ matrix.os }} - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Flutter Integration Test 3 - uses: ./.github/actions/flutter_integration_test - with: - test_path: integration_test/desktop_runner_3.dart - flutter_version: ${{ env.FLUTTER_VERSION }} - rust_toolchain: ${{ env.RUST_TOOLCHAIN }} - cargo_make_version: ${{ env.CARGO_MAKE_VERSION }} - rust_target: ${{ matrix.target }} \ No newline at end of file diff --git a/.github/workflows/ios_ci.yaml b/.github/workflows/ios_ci.yaml deleted file mode 100644 index bc44cc7786..0000000000 --- a/.github/workflows/ios_ci.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: iOS CI - -on: - push: - branches: - - "main" - paths: - - ".github/workflows/mobile_ci.yaml" - - "frontend/**" - - "!frontend/appflowy_tauri/**" - - pull_request: - branches: - - "main" - paths: - - ".github/workflows/mobile_ci.yaml" - - "frontend/**" - - "!frontend/appflowy_tauri/**" - -env: - FLUTTER_VERSION: "3.19.0" - RUST_TOOLCHAIN: "1.75" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build: - if: github.event.pull_request.draft != true - strategy: - fail-fast: true - matrix: - os: [macos-14] - runs-on: ${{ matrix.os }} - - steps: - - 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: aarch64-apple-ios-sim - 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: 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-apple-ios-sim - cargo install --force duckscript_cli - cargo install cargo-lipo - cargo make appflowy-flutter-deps-tools - shell: bash - - - name: Build AppFlowy - working-directory: frontend - run: | - cargo make --profile development-ios-arm64-sim appflowy-core-dev-ios - cargo make --profile development-ios-arm64-sim code_generation - - - uses: futureware-tech/simulator-action@v3 - id: simulator-action - with: - model: 'iPhone 15' - shutdown_after_job: false - - # enable it again if the 12 mins timeout is fixed - # - name: Run integration tests - # working-directory: frontend/appflowy_flutter - # run: flutter test integration_test/runner.dart -d ${{ steps.simulator-action.outputs.udid }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f8fc9cac64..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,495 +0,0 @@ -name: release - -on: - push: - tags: - - "*" - -env: - FLUTTER_VERSION: "3.19.0" - RUST_TOOLCHAIN: "1.75" - -jobs: - create-release: - runs-on: ubuntu-latest - env: - RELEASE_NOTES_PATH: /tmp/release_notes - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build release notes - run: | - touch ${{ env.RELEASE_NOTES_PATH }} - cat CHANGELOG.md | sed -e '/./{H;$!d;}' -e "x;/##\ Version\ ${{ github.ref_name }}/"'!d;' >> ${{ env.RELEASE_NOTES_PATH }} - - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: v${{ github.ref }} - body_path: ${{ env.RELEASE_NOTES_PATH }} - - # the package name should be with the format: AppFlowy--- - - build-for-windows: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) - needs: create-release - env: - WINDOWS_APP_RELEASE_PATH: frontend\appflowy_flutter\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 source code - uses: actions/checkout@v4 - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - target: ${{ matrix.job.target }} - override: true - components: rustfmt - profile: minimal - - - name: Install prerequisites - working-directory: frontend - run: | - vcpkg integrate install - cargo install --force cargo-make - cargo install --force duckscript_cli - - - name: Build Windows app - working-directory: frontend - # the cargo make script has to be run separately because of file locking issues - run: | - flutter config --enable-windows-desktop - dart ./scripts/flutter_release_build/build_flowy.dart exclude-directives . ${{ github.ref_name }} - cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy - dart ./scripts/flutter_release_build/build_flowy.dart include-directives . ${{ github.ref_name }} - - - 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 file - working-directory: frontend - run: | - cp scripts/windows_installer/* ../${{ env.WINDOWS_APP_RELEASE_PATH }} - - - name: Build installer executable - working-directory: ${{ env.WINDOWS_APP_RELEASE_PATH }} - run: | - iscc /F${{ env.WINDOWS_INSTALLER_NAME }} inno_setup_config.iss /DAppVersion=${{ github.ref_name }} - - - name: Upload Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - 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_content_type: application/octet-stream - - - name: Upload Installer Asset - id: upload-installer-asset - uses: actions/upload-release-asset@v1 - env: - 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_content_type: application/octet-stream - - build-for-macOS-x86_64: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] - runs-on: ${{ matrix.job.os }} - needs: create-release - env: - MACOS_APP_RELEASE_PATH: frontend/appflowy_flutter/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-11, extra-build-args: "" } - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - target: ${{ matrix.job.target }} - override: true - components: rustfmt - profile: minimal - - - name: Install prerequisites - working-directory: frontend - run: | - cargo install --force cargo-make - cargo install --force duckscript_cli - - - name: Build AppFlowy - working-directory: frontend - run: | - flutter config --enable-macos-desktop - dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }} - - - name: Codesign AppFlowy - run: | - echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12 - security create-keychain -p action build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p action build.keychain - security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain - /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v - - - name: Create macOS dmg - run: | - 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: Notarize AppFlowy - run: | - xcrun notarytool submit ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }} -v -f "json" --wait - - - name: Archive Asset - working-directory: ${{ env.MACOS_APP_RELEASE_PATH }} - run: zip --symlinks -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app - - - name: Upload Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - 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 Asset - uses: actions/upload-release-asset@v1 - env: - 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 - - build-for-macOS-universal: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] - runs-on: ${{ matrix.job.os }} - needs: create-release - env: - MACOS_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ github.ref_name }}/macos/Release - MACOS_AARCH64_ZIP_NAME: AppFlowy-${{ github.ref_name }}-macos-universal.zip - MACOS_DMG_NAME: AppFlowy-${{ github.ref_name }}-macos-universal - strategy: - fail-fast: false - matrix: - job: - - { - targets: "aarch64-apple-darwin,x86_64-apple-darwin", - os: macos-11, - extra-build-args: "", - } - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - targets: ${{ matrix.job.targets }} - components: rustfmt - - - name: Install prerequisites - working-directory: frontend - run: | - cargo install --force cargo-make - cargo install --force duckscript_cli - - - name: Build AppFlowy - working-directory: frontend - run: | - flutter config --enable-macos-desktop - sh scripts/flutter_release_build/build_universal_package_for_macos.sh ${{ github.ref_name }} - - - name: Codesign AppFlowy - run: | - echo ${{ secrets.MACOS_CERTIFICATE }} | base64 --decode > certificate.p12 - security create-keychain -p action build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p action build.keychain - security import certificate.p12 -k build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k action build.keychain - /usr/bin/codesign --force --options runtime --deep --sign "${{ secrets.MACOS_CODESIGN_ID }}" "${{ env.MACOS_APP_RELEASE_PATH }}/AppFlowy.app" -v - - - name: Create macOS dmg - run: | - 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: Notarize AppFlowy - run: | - xcrun notarytool submit ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_DMG_NAME }}.dmg --apple-id ${{ secrets.MACOS_NOTARY_USER }} --team-id ${{ secrets.MACOS_TEAM_ID }} --password ${{ secrets.MACOS_NOTARY_PWD }} -v -f "json" --wait - - - name: Archive Asset - working-directory: ${{ env.MACOS_APP_RELEASE_PATH }} - run: zip --symlinks -qr ${{ env.MACOS_AARCH64_ZIP_NAME }} AppFlowy.app - - - name: Upload Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_AARCH64_ZIP_NAME }} - asset_name: ${{ env.MACOS_AARCH64_ZIP_NAME }} - asset_content_type: application/octet-stream - - - name: Upload DMG Asset - uses: actions/upload-release-asset@v1 - env: - 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 - - build-for-linux: - name: ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-args }}] - runs-on: ${{ matrix.job.os }} - needs: create-release - env: - LINUX_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ github.ref_name }}/linux/Release - LINUX_ZIP_NAME: AppFlowy-${{ matrix.job.target }}-x86_64.tar.gz - LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb - LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm - LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm - LINUX_PACKAGE_TMP_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-x86_64.AppImage - LINUX_PACKAGE_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.AppImage - LINUX_PACKAGE_ZIP_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.tar.gz - - strategy: - fail-fast: false - matrix: - job: - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-args: "", - flutter_profile: production-linux-x86_64, - } - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - target: ${{ matrix.job.target }} - override: true - components: rustfmt - profile: minimal - - - name: Install prerequisites - 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 libnotify-dev - sudo apt-get -y install alien - 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 libgtk-3-0 - - - name: Build AppFlowy - working-directory: frontend - run: | - flutter config --enable-linux-desktop - dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }} - - - name: Archive Asset - working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} - run: tar -czf ${{ env.LINUX_ZIP_NAME }} * - - - name: Build Linux package (.deb) - working-directory: frontend - run: | - sh scripts/linux_distribution/deb/build_deb.sh appflowy_flutter/product/${{ github.ref_name }}/linux/Release ${{ github.ref_name }} ${{ env.LINUX_PACKAGE_DEB_NAME }} - - - name: Build Linux package (.rpm) - working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} - run: | - sudo alien -r ${{ env.LINUX_PACKAGE_DEB_NAME }} - cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }} - - - name: Build Linux package (.AppImage) - working-directory: frontend - continue-on-error: true - run: | - sh scripts/linux_distribution/appimage/build_appimage.sh ${{ github.ref_name }} - cd .. - cp -r frontend/${{ env.LINUX_PACKAGE_TMP_APPIMAGE_NAME }} ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_APPIMAGE_NAME }} - - - name: Upload Asset - id: upload-release-asset - 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_ZIP_NAME }} - asset_name: ${{ env.LINUX_PACKAGE_ZIP_NAME }} - asset_content_type: application/octet-stream - - - name: Upload Debian package - id: upload-release-asset-install-package-deb - 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_DEB_NAME }} - asset_name: ${{ env.LINUX_PACKAGE_DEB_NAME }} - asset_content_type: application/octet-stream - - - name: Upload RPM package - id: upload-release-asset-install-package-rpm - 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_RPM_NAME }} - asset_name: ${{ env.LINUX_PACKAGE_RPM_NAME }} - asset_content_type: application/octet-stream - - - name: Upload AppImage package - id: upload-release-asset-install-package-appimage - 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_APPIMAGE_NAME }} - asset_name: ${{ env.LINUX_PACKAGE_APPIMAGE_NAME }} - asset_content_type: application/octet-stream - - build-for-docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push - uses: docker/build-push-action@v5 - 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=max - - notify-discord: - runs-on: ubuntu-latest - needs: - [ - build-for-linux, - build-for-windows, - build-for-macOS-x86_64, - build-for-macOS-universal, - ] - steps: - - name: Notify Discord - run: | - curl -H "Content-Type: application/json" -d '{"username": "release@appflowy", "content": "🎉 AppFlowy ${{ github.ref_name }} is available. https://github.com/AppFlowy-IO/AppFlowy/releases/tag/'${{ github.ref_name }}'"}' "https://discord.com/api/webhooks/${{ secrets.DISCORD }}" - shell: bash diff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yaml index 7251939de6..37c0e74e77 100644 --- a/.github/workflows/rust_ci.yaml +++ b/.github/workflows/rust_ci.yaml @@ -1,21 +1,6 @@ name: Rust-CI -on: - push: - branches: - - "main" - - "develop" - - "release/*" - paths: - - "frontend/rust-lib/**" - - pull_request: - branches: - - "main" - - "develop" - - "release/*" - paths: - - "frontend/rust-lib/**" +on: push env: CARGO_TERM_COLOR: always @@ -82,7 +67,7 @@ jobs: - name: Run Docker-Compose working-directory: AppFlowy-Cloud run: | - docker pull appflowyinc/appflowy_cloud:latest + docker compose pull docker compose up -d - name: Run rust-lib tests diff --git a/.github/workflows/rust_coverage.yml b/.github/workflows/rust_coverage.yml deleted file mode 100644 index 426e36b619..0000000000 --- a/.github/workflows/rust_coverage.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Rust code coverage - -on: - push: - branches: - - "main" - - "release/*" - paths: - - "frontend/rust-lib/**" - -env: - CARGO_TERM_COLOR: always - FLUTTER_VERSION: "3.19.0" - RUST_TOOLCHAIN: "1.75" - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - name: Checkout source code - uses: actions/checkout@v4 - - - name: Install Rust toolchain - id: rust_toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - target: ${{ matrix.job.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 - - - 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: Install code-coverage tools - 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 keybinder-3.0 - cargo install grcov - rustup component add llvm-tools-preview - - - name: Run tests - working-directory: frontend - run: cargo make rust_unit_test_with_coverage diff --git a/.github/workflows/tauri2_ci.yaml b/.github/workflows/tauri2_ci.yaml deleted file mode 100644 index 06ce87d2fe..0000000000 --- a/.github/workflows/tauri2_ci.yaml +++ /dev/null @@ -1,113 +0,0 @@ -name: Tauri2-CI -on: - pull_request: - paths: - - ".github/workflows/tauri2_ci.yaml" - - "frontend/rust-lib/**" - - "frontend/appflowy_web_app/**" - - "frontend/resources/**" - -env: - NODE_VERSION: "18.16.0" - PNPM_VERSION: "8.5.0" - RUST_TOOLCHAIN: "1.75" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - tauri-build: - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - platform: [ ubuntu-20.04 ] - - runs-on: ${{ matrix.platform }} - - env: - CI: true - steps: - - uses: actions/checkout@v4 - - - name: Maximize build space (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo docker image prune --all --force - sudo rm -rf /opt/hostedtoolcache/codeQL - sudo rm -rf ${GITHUB_WORKSPACE}/.git - sudo rm -rf $ANDROID_HOME/ndk - - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: setup pnpm - uses: pnpm/action-setup@v2 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Install Rust toolchain - id: rust_toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - profile: minimal - - - name: Rust cache - uses: swatinem/rust-cache@v2 - with: - workspaces: "./frontend/appflowy_web_app/src-tauri -> target" - - - name: Node_modules cache - uses: actions/cache@v2 - with: - path: frontend/appflowy_web_app/node_modules - key: node-modules-${{ runner.os }} - - - name: install dependencies (windows only) - if: matrix.platform == 'windows-latest' - working-directory: frontend - run: | - cargo install --force duckscript_cli - vcpkg integrate install - - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - working-directory: frontend - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - - - name: install cargo-make - working-directory: frontend - run: | - cargo install --force cargo-make - cargo make appflowy-tauri-deps-tools - - - name: install frontend dependencies - working-directory: frontend/appflowy_web_app - run: | - mkdir dist - pnpm install - cd src-tauri && cargo build - - - name: test and lint - working-directory: frontend/appflowy_web_app - run: | - pnpm run lint:tauri - - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tauriScript: pnpm tauri - projectPath: frontend/appflowy_web_app - args: "--debug" \ No newline at end of file diff --git a/.github/workflows/tauri_ci.yaml b/.github/workflows/tauri_ci.yaml deleted file mode 100644 index 462bebb8dd..0000000000 --- a/.github/workflows/tauri_ci.yaml +++ /dev/null @@ -1,114 +0,0 @@ -name: Tauri-CI -on: - pull_request: - paths: - - ".github/workflows/tauri_ci.yaml" - - "frontend/rust-lib/**" - - "frontend/appflowy_tauri/**" - - "frontend/resources/**" - -env: - NODE_VERSION: "18.16.0" - PNPM_VERSION: "8.5.0" - RUST_TOOLCHAIN: "1.75" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - tauri-build: - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - platform: [ubuntu-20.04] - - runs-on: ${{ matrix.platform }} - - env: - CI: true - steps: - - uses: actions/checkout@v4 - - - name: Maximize build space (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo docker image prune --all --force - sudo rm -rf /opt/hostedtoolcache/codeQL - sudo rm -rf ${GITHUB_WORKSPACE}/.git - sudo rm -rf $ANDROID_HOME/ndk - - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: setup pnpm - uses: pnpm/action-setup@v2 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Install Rust toolchain - id: rust_toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - profile: minimal - - - name: Rust cache - uses: swatinem/rust-cache@v2 - with: - workspaces: "./frontend/appflowy_tauri/src-tauri -> target" - - - name: Node_modules cache - uses: actions/cache@v2 - with: - path: frontend/appflowy_tauri/node_modules - key: node-modules-${{ runner.os }} - - - name: install dependencies (windows only) - if: matrix.platform == 'windows-latest' - working-directory: frontend - run: | - cargo install --force duckscript_cli - vcpkg integrate install - - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' - working-directory: frontend - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - - - name: install cargo-make - working-directory: frontend - run: | - cargo install --force cargo-make - cargo make appflowy-tauri-deps-tools - - - name: install frontend dependencies - working-directory: frontend/appflowy_tauri - run: | - mkdir dist - pnpm install - cargo make --cwd .. tauri_build - - - name: frontend tests and linting - working-directory: frontend/appflowy_tauri - run: | - pnpm test - pnpm test:errors - - - uses: tauri-apps/tauri-action@v0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tauriScript: pnpm tauri - projectPath: frontend/appflowy_tauri - args: "--debug" \ No newline at end of file diff --git a/.github/workflows/tauri_release.yml b/.github/workflows/tauri_release.yml deleted file mode 100644 index 2e4be46dbe..0000000000 --- a/.github/workflows/tauri_release.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: Publish Tauri Release - -on: - workflow_dispatch: - inputs: - branch: - description: 'The branch to release' - required: true - default: 'main' - version: - description: 'The version to release' - required: true - default: '0.0.0' -env: - NODE_VERSION: "18.16.0" - PNPM_VERSION: "8.5.0" - RUST_TOOLCHAIN: "1.75" - -jobs: - - publish-tauri: - permissions: - contents: write - strategy: - fail-fast: false - matrix: - settings: - - platform: windows-latest - args: "--verbose" - target: "windows-x86_64" - - platform: macos-latest - args: "--target x86_64-apple-darwin" - target: "macos-x86_64" - - platform: ubuntu-20.04 - args: "--target x86_64-unknown-linux-gnu" - target: "linux-x86_64" - - runs-on: ${{ matrix.settings.platform }} - - env: - CI: true - PACKAGE_PREFIX: AppFlowy_Tauri-${{ github.event.inputs.version }}-${{ matrix.settings.target }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - - - name: Maximize build space (ubuntu only) - if: matrix.settings.platform == 'ubuntu-20.04' - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - sudo docker image prune --all --force - sudo rm -rf /opt/hostedtoolcache/codeQL - sudo rm -rf ${GITHUB_WORKSPACE}/.git - sudo rm -rf $ANDROID_HOME/ndk - - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: setup pnpm - uses: pnpm/action-setup@v2 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Install Rust toolchain - id: rust_toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - profile: minimal - - - name: Rust cache - uses: swatinem/rust-cache@v2 - with: - workspaces: "./frontend/appflowy_tauri/src-tauri -> target" - - - name: install dependencies (windows only) - if: matrix.settings.platform == 'windows-latest' - working-directory: frontend - run: | - cargo install --force duckscript_cli - vcpkg integrate install - - - name: install dependencies (ubuntu only) - if: matrix.settings.platform == 'ubuntu-20.04' - working-directory: frontend - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf - - - name: install cargo-make - working-directory: frontend - run: | - cargo install --force cargo-make - cargo make appflowy-tauri-deps-tools - - - name: install frontend dependencies - working-directory: frontend/appflowy_tauri - run: | - mkdir dist - pnpm install - pnpm exec node scripts/update_version.cjs ${{ github.event.inputs.version }} - cargo make --cwd .. tauri_build - - - uses: tauri-apps/tauri-action@dev - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }} - APPLE_SIGNING_IDENTITY: ${{ secrets.MACOS_TEAM_ID }} - APPLE_ID: ${{ secrets.MACOS_NOTARY_USER }} - APPLE_TEAM_ID: ${{ secrets.MACOS_TEAM_ID }} - APPLE_PASSWORD: ${{ secrets.MACOS_NOTARY_PWD }} - CI: true - with: - args: ${{ matrix.settings.args }} - appVersion: ${{ github.event.inputs.version }} - tauriScript: pnpm tauri - projectPath: frontend/appflowy_tauri - - - name: Upload EXE package(windows only) - uses: actions/upload-artifact@v4 - if: matrix.settings.platform == 'windows-latest' - with: - name: ${{ env.PACKAGE_PREFIX }}.exe - path: frontend/appflowy_tauri/src-tauri/target/release/bundle/nsis/AppFlowy_${{ github.event.inputs.version }}_x64-setup.exe - - - name: Upload DMG package(macos only) - uses: actions/upload-artifact@v4 - if: matrix.settings.platform == 'macos-latest' - with: - name: ${{ env.PACKAGE_PREFIX }}.dmg - path: frontend/appflowy_tauri/src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/AppFlowy_${{ github.event.inputs.version }}_x64.dmg - - - name: Upload Deb package(ubuntu only) - uses: actions/upload-artifact@v4 - if: matrix.settings.platform == 'ubuntu-20.04' - with: - name: ${{ env.PACKAGE_PREFIX }}.deb - path: frontend/appflowy_tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/app-flowy_${{ github.event.inputs.version }}_amd64.deb - - - name: Upload AppImage package(ubuntu only) - uses: actions/upload-artifact@v4 - if: matrix.settings.platform == 'ubuntu-20.04' - with: - name: ${{ env.PACKAGE_PREFIX }}.AppImage - path: frontend/appflowy_tauri/src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/app-flowy_${{ github.event.inputs.version }}_amd64.AppImage diff --git a/.github/workflows/translation_notify.yml b/.github/workflows/translation_notify.yml deleted file mode 100644 index 84142424c7..0000000000 --- a/.github/workflows/translation_notify.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Translation Notify -on: - push: - branches: [ main ] - paths: - - "frontend/appflowy_flutter/assets/translations/en.json" - -jobs: - Discord-Notify: - runs-on: ubuntu-latest - steps: - - uses: Ilshidur/action-discord@master - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - args: | - @appflowytranslators English UI strings has been updated. - Link to changes: ${{github.event.compare}} diff --git a/.github/workflows/web2_ci.yaml b/.github/workflows/web2_ci.yaml deleted file mode 100644 index 31d6f5d8b3..0000000000 --- a/.github/workflows/web2_ci.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Web2-CI -on: - pull_request: - paths: - - ".github/workflows/web2_ci.yaml" - - "frontend/appflowy_web_app/**" - - "frontend/resources/**" -env: - NODE_VERSION: "18.16.0" - PNPM_VERSION: "8.5.0" -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true -jobs: - web-build: - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - platform: [ ubuntu-latest ] - - runs-on: ${{ matrix.platform }} - - steps: - - uses: actions/checkout@v4 - - name: Maximize build space (ubuntu only) - if: matrix.platform == '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" - sudo docker image prune --all --force - sudo rm -rf /opt/hostedtoolcache/codeQL - sudo rm -rf ${GITHUB_WORKSPACE}/.git - sudo rm -rf $ANDROID_HOME/ndk - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - name: setup pnpm - uses: pnpm/action-setup@v2 - with: - version: ${{ env.PNPM_VERSION }} - - name: Node_modules cache - uses: actions/cache@v2 - with: - path: frontend/appflowy_web_app/node_modules - key: node-modules-${{ runner.os }} - - name: install frontend dependencies - working-directory: frontend/appflowy_web_app - run: | - pnpm install - - name: test and lint - working-directory: frontend/appflowy_web_app - run: | - pnpm run lint - - name: build - working-directory: frontend/appflowy_web_app - run: | - pnpm run build \ No newline at end of file diff --git a/.github/workflows/web_ci.yaml b/.github/workflows/web_ci.yaml deleted file mode 100644 index 2e92b33226..0000000000 --- a/.github/workflows/web_ci.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: WEB-CI - -on: - workflow_dispatch: - inputs: - build: - description: 'Build the web app' - required: true - default: 'true' - -env: - CARGO_TERM_COLOR: always - NODE_VERSION: "18.16.0" - PNPM_VERSION: "8.5.0" - RUST_TOOLCHAIN: "1.75" - CARGO_MAKE_VERSION: "0.36.6" - -jobs: - web-build: - if: github.event.pull_request.draft != true - strategy: - fail-fast: false - matrix: - platform: [ ubuntu-latest ] - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v4 - - name: setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 - with: - key: rust-dependencies-${{ runner.os }} - workspaces: | - frontend/rust-lib - frontend/appflowy_web/appflowy_wasm - - # TODO: Can combine caching deps and node_modules in one - # See Glob patterns: https://github.com/actions/toolkit/tree/main/packages/glob - - name: Cache Node.js dependencies - uses: actions/cache@v4 - with: - path: ~/.npm - key: npm-${{ runner.os }} - - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: frontend/appflowy_web/node_modules - key: node-modules-${{ runner.os }} - - - name: Install Rust toolchain - id: rust_toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - profile: minimal - - - name: Install wasm-pack - run: cargo install wasm-pack - - - uses: taiki-e/install-action@v2 - with: - tool: cargo-make@${{ env.CARGO_MAKE_VERSION }} - - - name: install dependencies - if: matrix.platform == 'ubuntu-latest' - working-directory: frontend - run: | - sudo apt-get update - npm install -g pnpm@${{ env.PNPM_VERSION }} - cargo make install_web_protobuf - - - name: Build - working-directory: frontend/appflowy_web - run: | - pnpm install - pnpm run build_release_wasm