Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

ci: build macos on pull request (#1854)

Himself65626b906bc01d
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 97bc6f079e..b15ee62efe 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -81,6 +81,51 @@ jobs:
path: ./apps/web/.next
if-no-files-found: error
+ build-macos:
+ name: Build macOS desktop app
+ runs-on: macos-latest
+ environment: development
+ needs:
+ - build
+ - install-all
+ strategy:
+ matrix:
+ arch: [arm64]
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup Node.js
+ uses: ./.github/actions/setup-node
+ with:
+ electron-workspace-install: true
+
+ - name: Download artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: next-js
+ path: ./apps/web/.next
+
+ - name: install Rust stable
+ uses: dtolnay/rust-toolchain@stable
+
+ - name: add arm64 target
+ if: matrix.arch == 'arm64'
+ run: rustup target add aarch64-apple-darwin
+
+ - name: Rust cache
+ uses: swatinem/rust-cache@v2
+ with:
+ workspaces: './packages/octobase-node -> target'
+
+ - name: make build
+ run: yarn make-macos-${{ matrix.arch }}
+ working-directory: apps/electron
+
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v3
+ with:
+ name: affine-darwin-${{ matrix.arch }}-builds
+ path: builds
+
storybook-test:
name: Storybook Test
runs-on: ubuntu-latest
diff --git a/apps/electron/forge.config.js b/apps/electron/forge.config.js
index e8aaf14d16..ac8afcaeda 100644
--- a/apps/electron/forge.config.js
+++ b/apps/electron/forge.config.js
@@ -5,13 +5,15 @@ module.exports = {
osxSign: {
identity: 'Developer ID Application: TOEVERYTHING PTE. LTD.',
'hardened-runtime': true,
- }, // object must exist even if empty
- osxNotarize: {
- tool: 'notarytool',
- appleId: process.env.APPLE_ID,
- appleIdPassword: process.env.APPLE_PASSWORD,
- teamId: process.env.APPLE_TEAM_ID,
},
+ osxNotarize: process.env.APPLE_ID
+ ? {
+ tool: 'notarytool',
+ appleId: process.env.APPLE_ID,
+ appleIdPassword: process.env.APPLE_PASSWORD,
+ teamId: process.env.APPLE_TEAM_ID,
+ }
+ : undefined,
},
makers: [
{