From aa3b2d629015109afcc971273641cba2c93ae51f Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 26 Jul 2024 11:04:02 +0800 Subject: [PATCH] chore(version): 0.3.7 --- electron-builder.yml | 7 +++++-- package.json | 5 +++-- scripts/version.js | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 scripts/version.js diff --git a/electron-builder.yml b/electron-builder.yml index 3b0976a31..d544132c6 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -56,5 +56,8 @@ electronDownload: afterSign: scripts/notarize.js releaseInfo: releaseNotes: | - 新增设置面板,方便进行消息功能设置 - 可以自定义消息字体样式 + 1. 保存聊天页面状态,切换页面后恢复 + 2. 修复默认助手名称为空时候的显示问题 + 3. 简化系统内置智能体提示词长度 + 4. 增加单个聊天内容保存到本地功能 + 5. 系统内置提供商支持修改 API 地址 diff --git a/package.json b/package.json index cb5f9d098..87f2307f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cherry-studio", - "version": "0.3.6", + "version": "0.3.7", "description": "A powerful AI assistant for producer.", "main": "./out/main/index.js", "author": "kangfenmao@qq.com", @@ -18,7 +18,8 @@ "build:unpack": "dotenv npm run build && electron-builder --dir", "build:win": "dotenv npm run build && electron-builder --win --publish never", "build:mac": "dotenv electron-vite build && electron-builder --mac --publish never", - "build:linux": "dotenv electron-vite build && electron-builder --linux --publish never" + "build:linux": "dotenv electron-vite build && electron-builder --linux --publish never", + "release": "node scripts/version.js" }, "dependencies": { "@electron-toolkit/preload": "^3.0.0", diff --git a/scripts/version.js b/scripts/version.js new file mode 100644 index 000000000..a4b7e2c14 --- /dev/null +++ b/scripts/version.js @@ -0,0 +1,40 @@ +const { execSync } = require('child_process') +const fs = require('fs') + +// 执行命令并返回输出 +function exec(command) { + return execSync(command, { encoding: 'utf8' }).trim() +} + +// 获取命令行参数 +const args = process.argv.slice(2) +const versionType = args[0] || 'patch' +const shouldPush = args.includes('push') + +// 验证版本类型 +if (!['patch', 'minor', 'major'].includes(versionType)) { + console.error('Invalid version type. Use patch, minor, or major.') + process.exit(1) +} + +// 更新版本 +exec(`yarn version ${versionType} --immediate`) + +// 读取更新后的 package.json 获取新版本号 +const updatedPackageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')) +const newVersion = updatedPackageJson.version + +// Git 操作 +exec('git add .') +exec(`git commit -m "chore(version): ${newVersion}"`) +exec(`git tag -a v${newVersion} -m "Version ${newVersion}"`) + +console.log(`Version bumped to ${newVersion}`) + +if (shouldPush) { + console.log('Pushing to remote...') + exec('git push && git push --tags') + console.log('Pushed to remote.') +} else { + console.log('Changes are committed locally. Use "git push && git push --tags" to push to remote.') +}