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.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix(electron): check bundle (#3527)
Alex Yang33613c7041d5
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 50a81bdfc5..de3d480e10 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -431,12 +431,13 @@ jobs:- name: Make bundleif: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}+ env:+ SKIP_BUNDLE: truerun: yarn workspace @affine/electron make --platform=darwin --arch=arm64- name: Bundle output checkif: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}run: |- ./scripts/unzip-macos-arm64.shyarn ts-node-esm ./scripts/macos-arm64-output-check.mtsworking-directory: apps/electrondiff --git a/apps/electron/forge.config.js b/apps/electron/forge.config.jsindex bd974f38ef..3025e798e6 100644--- a/apps/electron/forge.config.js+++ b/apps/electron/forge.config.js@@ -28,6 +28,59 @@ const arch =const windowsIconUrl = `https://cdn.affine.pro/app-icons/icon_${buildType}.ico`;+const makers = [+ !process.env.SKIP_BUNDLE && {+ name: '@affine/maker-dmg',+ config: {+ format: 'ULFO',+ icon: icnsPath,+ name: 'AFFiNE',+ 'icon-size': 128,+ background: path.resolve(+ __dirname,+ './resources/icons/dmg-background.png'+ ),+ file: path.resolve(+ __dirname,+ 'out',+ buildType,+ `${productName}-darwin-${arch}`,+ `${productName}.app`+ ),+ },+ },+ {+ name: '@electron-forge/maker-zip',+ config: {+ name: 'affine',+ iconUrl: icoPath,+ setupIcon: icoPath,+ platforms: ['darwin', 'linux', 'win32'],+ },+ },+ !process.env.SKIP_BUNDLE && {+ name: '@electron-forge/maker-squirrel',+ config: {+ name: 'AFFiNE',+ setupIcon: icoPath,+ iconUrl: windowsIconUrl,+ loadingGif: './resources/icons/affine_installing.gif',+ },+ },+ !process.env.SKIP_BUNDLE && {+ name: '@reforged/maker-appimage',+ config: {+ name: 'AFFiNE',+ iconUrl: icoPath,+ setupIcon: icoPath,+ platforms: ['linux'],+ options: {+ bin: productName,+ },+ },+ },+].filter(Boolean);+/*** @type {import('@electron-forge/shared-types').ForgeConfig}*/@@ -57,58 +110,7 @@ module.exports = {// We need the following line for updaterextraResource: ['./resources/app-update.yml'],},- makers: [- {- name: '@affine/maker-dmg',- config: {- format: 'ULFO',- icon: icnsPath,- name: 'AFFiNE',- 'icon-size': 128,- background: path.resolve(- __dirname,- './resources/icons/dmg-background.png'- ),- file: path.resolve(- __dirname,- 'out',- buildType,- `${productName}-darwin-${arch}`,- `${productName}.app`- ),- },- },- {- name: '@electron-forge/maker-zip',- config: {- name: 'affine',- iconUrl: icoPath,- setupIcon: icoPath,- platforms: ['darwin', 'linux', 'win32'],- },- },- {- name: '@electron-forge/maker-squirrel',- config: {- name: 'AFFiNE',- setupIcon: icoPath,- iconUrl: windowsIconUrl,- loadingGif: './resources/icons/affine_installing.gif',- },- },- {- name: '@reforged/maker-appimage',- config: {- name: 'AFFiNE',- iconUrl: icoPath,- setupIcon: icoPath,- platforms: ['linux'],- options: {- bin: productName,- },- },- },- ],+ makers,hooks: {readPackageJson: async (_, packageJson) => {// we want different package name for canary builddiff --git a/apps/electron/scripts/macos-arm64-output-check.mts b/apps/electron/scripts/macos-arm64-output-check.mtsindex 81c2c8b9e9..550204c60b 100644--- a/apps/electron/scripts/macos-arm64-output-check.mts+++ b/apps/electron/scripts/macos-arm64-output-check.mts@@ -3,10 +3,11 @@ import { readdir } from 'node:fs/promises';const outputRoot = fileURLToPath(new URL(- '../zip-out/AFFiNE-canary.app/Contents/Resources/app',+ '../out/canary/AFFiNE-canary-darwin-arm64/AFFiNE-canary.app/Contents/Resources/app',import.meta.url));+const outputList = [['dist',diff --git a/apps/electron/scripts/unzip-macos-arm64.sh b/apps/electron/scripts/unzip-macos-arm64.shdeleted file mode 100755index 1790fcbd97..0000000000--- a/apps/electron/scripts/unzip-macos-arm64.sh+++ /dev/null@@ -1,16 +0,0 @@-#!/bin/bash--# Set the directory-dir="./out/canary/make/zip/darwin/arm64"--# Get the first file-file=$(ls -1 $dir | head -n 1)--# Check if file exists and is a zip file-if [ -f "$dir/$file" ] && [ ${file: -4} == ".zip" ]-then- # Unzip the file- unzip "$dir/$file" -d "zip-out"-else- echo "No zip file found"-fi