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.
This commit is contained in:
zhanggy committed 2025-10-28 22:53:26 +08:00
1 parent ac5488a21d
commit 0eb2dcf8c2
22 files changed
+882 -92

No files matched your search

+11 -2
View File
@@ -2,12 +2,23 @@
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}'
@@ -90,8 +101,6 @@ const baseConfig = {
}
}
dotenv.config()
baseConfig.copyright = `ⓒ ${new Date().getFullYear()} $\{author}`
baseConfig.files = [
/* A list of files not to be included in the build. */