[PR #3124] [MERGED] chore: Support CI build universal macOS package #5581

Closed
opened 2026-03-23 22:19:23 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3124
Author: @LucasXu0
Created: 8/6/2023
Status: Merged
Merged: 8/6/2023
Merged by: @LucasXu0

Base: mainHead: support_ci_build_universal_macos


📝 Commits (3)

  • c90c69a fix: macos release build
  • 4b35a23 feat: support build arm64 macOS package on CI
  • 51d578b feat: support build arm64 macOS package on CI

📊 Changes

6 files changed (+136 additions, -16 deletions)

View changed files

📝 .github/workflows/release.yml (+88 -2)
📝 frontend/Makefile.toml (+12 -0)
📝 frontend/appflowy_flutter/macos/Podfile (+25 -12)
📝 frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj (+1 -1)
📝 frontend/scripts/flutter_release_build/build_universal_package_for_macos.sh (+1 -1)
📝 frontend/scripts/makefile/flutter.toml (+9 -0)

📄 Description

Feature Preview

Screenshot 2023-08-06 at 11 00 47

Command line

build the universal macOS package (support on the m1 or intel chip)

cd frontend
sh scripts/flutter_release_build/build_universal_package_for_macos.sh

build the arm64 macOS package (support on the m1 chip only)

cargo make --profile production-mac-arm64 appflowy

build the x86_64 macOS package (support on the m1 or intel chip)

cargo make --profile production-mac-x86_64 appflowy

It doesn't support building the arm64 package only on Intel mac. The error log: https://github.com/LucasXu0/AppFlowy/actions/runs/5771555525/job/15645635129

  build-for-macOS-arm64:
    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-aarch64.zip
      MACOS_DMG_NAME: AppFlowy_${{ github.ref_name }}_macos-aarch64
    strategy:
      fail-fast: false
      matrix:
        job:
          - { target: aarch64-apple-darwin, os: macos-11, extra-build-args: "" }
    steps:
      - 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: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ env.RUST_TOOLCHAIN }}
          target: ${{ matrix.job.target }}
          override: true
          components: rustfmt
          profile: minimal

      - uses: Swatinem/rust-cache@v2
        with:
          prefix-key: appflowy-lib-cache
          key: ${{ matrix.job.os }}-${{ matrix.job.target }}

      - 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
          cargo make --profile production-mac-arm64 appflowy

      - 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: 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

PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/3124 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 8/6/2023 **Status:** ✅ Merged **Merged:** 8/6/2023 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `support_ci_build_universal_macos` --- ### 📝 Commits (3) - [`c90c69a`](https://github.com/AppFlowy-IO/AppFlowy/commit/c90c69a8d97932c0d588e2c8de9a3c7a294f7870) fix: macos release build - [`4b35a23`](https://github.com/AppFlowy-IO/AppFlowy/commit/4b35a23c5d60aa146a49d36f4ac6bddea3a4c002) feat: support build arm64 macOS package on CI - [`51d578b`](https://github.com/AppFlowy-IO/AppFlowy/commit/51d578b0161df7995724c8cec62436fde075016d) feat: support build arm64 macOS package on CI ### 📊 Changes **6 files changed** (+136 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yml` (+88 -2) 📝 `frontend/Makefile.toml` (+12 -0) 📝 `frontend/appflowy_flutter/macos/Podfile` (+25 -12) 📝 `frontend/appflowy_flutter/macos/Runner.xcodeproj/project.pbxproj` (+1 -1) 📝 `frontend/scripts/flutter_release_build/build_universal_package_for_macos.sh` (+1 -1) 📝 `frontend/scripts/makefile/flutter.toml` (+9 -0) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <img width="1022" alt="Screenshot 2023-08-06 at 11 00 47" src="https://github.com/AppFlowy-IO/AppFlowy/assets/11863087/d800e1e9-f2a9-423b-9e6b-95af8685b597"> ## Command line ### build the universal macOS package (support on the m1 or intel chip) ```sh cd frontend sh scripts/flutter_release_build/build_universal_package_for_macos.sh ``` ### build the arm64 macOS package (support on the m1 chip only) ```sh cargo make --profile production-mac-arm64 appflowy ``` ### build the x86_64 macOS package (support on the m1 or intel chip) ```sh cargo make --profile production-mac-x86_64 appflowy ``` It doesn't support building the arm64 package only on Intel mac. The error log: https://github.com/LucasXu0/AppFlowy/actions/runs/5771555525/job/15645635129 ```yaml build-for-macOS-arm64: 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-aarch64.zip MACOS_DMG_NAME: AppFlowy_${{ github.ref_name }}_macos-aarch64 strategy: fail-fast: false matrix: job: - { target: aarch64-apple-darwin, os: macos-11, extra-build-args: "" } steps: - 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: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: ${{ env.RUST_TOOLCHAIN }} target: ${{ matrix.job.target }} override: true components: rustfmt profile: minimal - uses: Swatinem/rust-cache@v2 with: prefix-key: appflowy-lib-cache key: ${{ matrix.job.os }}-${{ matrix.job.target }} - 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 cargo make --profile production-mac-arm64 appflowy - 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: 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 ``` <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [x] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:19:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5581
No description provided.