From 7f28c78d8c101031a6207eb1769bb87ff28fa02e Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Thu, 3 Aug 2023 18:11:09 -0700 Subject: [PATCH] ci: skip build in the non-darwin platform --- apps/electron/forge.config.js | 74 +++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/apps/electron/forge.config.js b/apps/electron/forge.config.js index 0908dd9e6c..282ac04b97 100644 --- a/apps/electron/forge.config.js +++ b/apps/electron/forge.config.js @@ -26,44 +26,50 @@ const arch = ? process.argv[process.argv.indexOf('--arch') + 1] : process.arch; +const platform = + process.argv.indexOf('--platform') > 0 + ? process.argv[process.argv.indexOf('--platform') + 1] + : process.platform; + const windowsIconUrl = `https://cdn.affine.pro/app-icons/icon_${buildType}.ico`; const makers = [ - !process.env.SKIP_BUNDLE && { - name: '@electron-forge/maker-dmg', - config: { - format: 'ULFO', - icon: icnsPath, - name: 'AFFiNE', - 'icon-size': 128, - background: path.resolve( - __dirname, - './resources/icons/dmg-background.png' - ), - contents: [ - { - x: 176, - y: 192, - type: 'file', - path: path.resolve( - __dirname, - 'out', - buildType, - `${productName}-darwin-${arch}`, - `${productName}.app` - ), - }, - { x: 432, y: 192, type: 'link', path: '/Applications' }, - ], - file: path.resolve( - __dirname, - 'out', - buildType, - `${productName}-darwin-${arch}`, - `${productName}.app` - ), + !process.env.SKIP_BUNDLE && + platform === 'darwin' && { + name: '@electron-forge/maker-dmg', + config: { + format: 'ULFO', + icon: icnsPath, + name: 'AFFiNE', + 'icon-size': 128, + background: path.resolve( + __dirname, + './resources/icons/dmg-background.png' + ), + contents: [ + { + x: 176, + y: 192, + type: 'file', + path: path.resolve( + __dirname, + 'out', + buildType, + `${productName}-darwin-${arch}`, + `${productName}.app` + ), + }, + { x: 432, y: 192, type: 'link', path: '/Applications' }, + ], + file: path.resolve( + __dirname, + 'out', + buildType, + `${productName}-darwin-${arch}`, + `${productName}.app` + ), + }, }, - }, { name: '@electron-forge/maker-zip', config: {