-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0e51c3
commit aa3b2d6
Showing
3 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]", | ||
|
@@ -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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.') | ||
} |