128 lines
2.5 KiB
JavaScript
128 lines
2.5 KiB
JavaScript
/* eslint-disable no-template-curly-in-string */
|
||
const dotenv = require('dotenv')
|
||
const packageJson = require('../../package.json')
|
||
|
||
dotenv.config()
|
||
|
||
const baseConfig = {
|
||
productName: packageJson.name,
|
||
appId: packageJson.appId,
|
||
asar: true,
|
||
extends: null,
|
||
compression: 'maximum',
|
||
publish: [
|
||
{
|
||
provider: 'github',
|
||
owner: 'Jasery',
|
||
repo: 'gdt-tool',
|
||
releaseType: 'release',
|
||
token: process.env.GITHUB_TOKEN || process.env.GH_TOKEN || '' // 优先使用 GITHUB_TOKEN(GitHub Actions 自动提供)
|
||
}
|
||
],
|
||
artifactName: '${productName} ${version}_${arch}.${ext}',
|
||
directories: {
|
||
output: './release/${version}'
|
||
},
|
||
mac: {
|
||
bundleVersion: '1.0',
|
||
hardenedRuntime: true,
|
||
gatekeeperAssess: false,
|
||
notarize: false,
|
||
icon: 'buildAssets/icons/icon.icns',
|
||
type: 'distribution',
|
||
target: [
|
||
{
|
||
target: 'dmg',
|
||
arch: ['x64', 'arm64', 'universal']
|
||
}
|
||
]
|
||
},
|
||
dmg: {
|
||
contents: [
|
||
{
|
||
x: 410,
|
||
y: 150,
|
||
type: 'link',
|
||
path: '/Applications'
|
||
},
|
||
{
|
||
x: 130,
|
||
y: 150,
|
||
type: 'file'
|
||
}
|
||
],
|
||
sign: false
|
||
},
|
||
win: {
|
||
icon: 'buildAssets/icons/icon.ico',
|
||
target: [
|
||
{
|
||
target: 'appx',
|
||
arch: 'x64'
|
||
},
|
||
{
|
||
target: 'zip',
|
||
arch: 'x64'
|
||
},
|
||
{
|
||
target: 'portable',
|
||
arch: 'x64'
|
||
},
|
||
{
|
||
target: 'nsis',
|
||
arch: 'x64'
|
||
}
|
||
]
|
||
},
|
||
portable: {
|
||
artifactName: '${productName} ${version}_${arch} Portable.${ext}'
|
||
},
|
||
nsis: {
|
||
oneClick: true
|
||
},
|
||
linux: {
|
||
executableName: packageJson.name.toLowerCase(),
|
||
icon: 'buildAssets/icons',
|
||
category: 'Utility',
|
||
target: [
|
||
{
|
||
target: 'snap',
|
||
arch: 'x64'
|
||
},
|
||
{
|
||
target: 'deb',
|
||
arch: 'x64'
|
||
},
|
||
{
|
||
target: 'rpm',
|
||
arch: 'x64'
|
||
}
|
||
]
|
||
}
|
||
}
|
||
|
||
baseConfig.copyright = `ⓒ ${new Date().getFullYear()} $\{author}`
|
||
baseConfig.files = [
|
||
/* A list of files not to be included in the build. */
|
||
/*
|
||
(Required) The files and folders listed below should not be included in the build.
|
||
*/
|
||
'dist/**/*',
|
||
'!dist/main/index.dev.js',
|
||
'!docs/**/*',
|
||
'!tests/**/*',
|
||
'!release/**/*'
|
||
]
|
||
|
||
// TODO: Notarize for macOS
|
||
baseConfig.mac.identity = null
|
||
/* if (process.env.MAC_NOTARIZE === 'true') {
|
||
baseConfig.afterSign = './buildAssets/builder/notarize.ts'
|
||
} else {
|
||
baseConfig.mac.identity = null
|
||
} */
|
||
|
||
module.exports = {
|
||
...baseConfig
|
||
}
|