mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
build: add canary build (#1986)
Co-authored-by: Himself65 <himself65@outlook.com> Co-authored-by: Horus <lhlxtl@gmail.com>
This commit is contained in:
@@ -1,7 +1,30 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const {
|
||||
utils: { fromBuildIdentifier },
|
||||
} = require('@electron-forge/core');
|
||||
|
||||
const isCanary = process.env.BUILD_TYPE === 'canary';
|
||||
|
||||
const productName = isCanary ? 'AFFiNE-Canary' : 'AFFiNE';
|
||||
const icoPath = isCanary
|
||||
? './resources/icons/icon_canary.ico'
|
||||
: './resources/icons/icon.ico';
|
||||
const icnsPath = isCanary
|
||||
? './resources/icons/icon_canary.icns'
|
||||
: './resources/icons/icon.icns';
|
||||
|
||||
/**
|
||||
* @type {import('@electron-forge/shared-types').ForgeConfig}
|
||||
*/
|
||||
module.exports = {
|
||||
buildIdentifier: isCanary ? 'canary' : 'stable',
|
||||
packagerConfig: {
|
||||
name: 'AFFiNE',
|
||||
icon: './resources/icons/icon.icns',
|
||||
name: productName,
|
||||
appBundleId: fromBuildIdentifier({
|
||||
canary: 'pro.affine.canary',
|
||||
stable: 'pro.affine.app',
|
||||
}),
|
||||
icon: icnsPath,
|
||||
osxSign: {
|
||||
identity: 'Developer ID Application: TOEVERYTHING PTE. LTD.',
|
||||
'hardened-runtime': true,
|
||||
@@ -20,7 +43,7 @@ module.exports = {
|
||||
name: '@electron-forge/maker-dmg',
|
||||
config: {
|
||||
format: 'ULFO',
|
||||
icon: './resources/icons/icon.icns',
|
||||
icon: icnsPath,
|
||||
name: 'AFFiNE',
|
||||
},
|
||||
},
|
||||
@@ -28,20 +51,26 @@ module.exports = {
|
||||
name: '@electron-forge/maker-zip',
|
||||
config: {
|
||||
name: 'affine',
|
||||
iconUrl: './resources/icons/icon.ico',
|
||||
setupIcon: './resources/icons/icon.ico',
|
||||
iconUrl: icoPath,
|
||||
setupIcon: icoPath,
|
||||
platforms: ['darwin', 'linux', 'win32'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '@electron-forge/maker-squirrel',
|
||||
config: {
|
||||
name: 'AFFiNE',
|
||||
setupIcon: './resources/icons/icon.ico',
|
||||
setupIcon: icoPath,
|
||||
// loadingGif: './resources/icons/loading.gif',
|
||||
},
|
||||
},
|
||||
],
|
||||
hooks: {
|
||||
readPackageJson: async (_, packageJson) => {
|
||||
// we want different package name for canary build
|
||||
// so stable and canary will not share the same app data
|
||||
packageJson.productName = productName;
|
||||
},
|
||||
generateAssets: async (_, platform, arch) => {
|
||||
const { $ } = await import('zx');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user