Skip to content

Commit

Permalink
chore(version): 0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Jul 26, 2024
1 parent c0e51c3 commit aa3b2d6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
7 changes: 5 additions & 2 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ electronDownload:
afterSign: scripts/notarize.js
releaseInfo:
releaseNotes: |
新增设置面板,方便进行消息功能设置
可以自定义消息字体样式
1. 保存聊天页面状态,切换页面后恢复
2. 修复默认助手名称为空时候的显示问题
3. 简化系统内置智能体提示词长度
4. 增加单个聊天内容保存到本地功能
5. 系统内置提供商支持修改 API 地址
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
Expand All @@ -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",
Expand Down
40 changes: 40 additions & 0 deletions scripts/version.js
Original file line number Diff line number Diff line change
@@ -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.')
}

0 comments on commit aa3b2d6

Please sign in to comment.