Files
gdt-tool/buildAssets/builder/config.js
T
zhanggy 0eb2dcf8c2 feat: implement auto-update functionality with GitHub integration
- Added AutoUpdater class to manage update checks and downloads.
- Integrated auto-updater in the main process after the main window is created.
- Enhanced preload script to expose update-related IPC channels.
- Created UpdateDialog component to handle user interactions for updates.
- Implemented state management for update status using Pinia store.
- Added localization support for update messages in multiple languages.
- Documented auto-update configuration steps for private GitHub repositories.
- Created .env.example for GitHub token configuration.
2025-10-28 22:53:26 +08:00

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.GH_TOKEN || '' // 可选:从环境变量获取 GitHub Token,私有仓库必需
}
],
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
}