File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,18 +195,20 @@ function main() {
195195
196196 fs . writeFileSync ( outputPath , tsContent , 'utf-8' ) ;
197197
198+ // 读取 VERSION.txt 并同步到 version.ts
199+ const versionTxtPath = path . join ( process . cwd ( ) , 'VERSION.txt' ) ;
200+ const versionFromFile = fs . readFileSync ( versionTxtPath , 'utf8' ) . trim ( ) ;
201+ console . log ( `📄 VERSION.txt 版本: ${ versionFromFile } ` ) ;
202+ updateVersionTs ( versionFromFile ) ;
203+
198204 // 检查是否在 GitHub Actions 环境中运行
199205 const isGitHubActions = process . env . GITHUB_ACTIONS === 'true' ;
200206
201207 if ( isGitHubActions ) {
202- // 在 GitHub Actions 中,更新版本文件
203- console . log ( '正在更新版本文件 ...' ) ;
208+ // 在 GitHub Actions 中,更新 VERSION.txt 为 CHANGELOG 最新版本
209+ console . log ( '正在更新 VERSION.txt ...' ) ;
204210 updateVersionFile ( latestVersion ) ;
205211 updateVersionTs ( latestVersion ) ;
206- } else {
207- // 在本地运行时,只提示但不更新版本文件
208- console . log ( '🔧 本地运行模式:跳过版本文件更新' ) ;
209- console . log ( '💡 版本文件更新将在 git tag 触发的 release 工作流中完成' ) ;
210212 }
211213
212214 console . log ( `✅ 成功生成 ${ outputPath } ` ) ;
Original file line number Diff line number Diff line change 11/* eslint-disable no-console */
22
3- const CURRENT_VERSION = '100.1.0 ' ;
3+ const CURRENT_VERSION = '100.1.1 ' ;
44
55// 导出当前版本号供其他地方使用
66export { CURRENT_VERSION } ;
You can’t perform that action at this time.
0 commit comments