Skip to content

Commit 7508c58

Browse files
committed
feat: 更新版本信息处理和文档,添加GoReleaser相关配置
1 parent 395393e commit 7508c58

3 files changed

Lines changed: 27 additions & 9 deletions

File tree

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@ config.local.json
6161
/data/JG-Cursor-1_4_0-mac/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework
6262

6363
node_modules/
64-
data/*/node_modules/
64+
data/*/node_modules/
65+
66+
# GoReleaser相关文件
67+
/dist/
68+
.release-env

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ chmod +x jg-cursor-cracker
105105

106106
项目使用 GitHub Actions 进行持续集成,每次代码提交都会自动运行测试。
107107

108+
## 发布版本
109+
110+
本项目使用GoReleaser自动化发布流程,可以生成跨平台的二进制文件。发布新版本步骤:
111+
112+
1. 创建并推送一个新的标签
113+
```bash
114+
git tag -a v1.0.0 -m "第一个正式版本"
115+
git push origin v1.0.0
116+
```
117+
118+
2. GitHub Actions将自动构建并发布到GitHub Releases
119+
120+
详细信息请参考[发布指南](docs/release.md)
121+
108122
## 贡献代码
109123

110124
欢迎提交 Pull Request 或 Issue。在提交代码前,请确保所有测试能够通过。

cmd/version.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
)
99

1010
var (
11-
// 版本信息
12-
version = "dev"
13-
commit = "unknown"
14-
buildDate = "unknown"
15-
repoURL = "https://github.com/cursor-home/JG-Cursor-cracker"
11+
// 版本信息 - 这些变量将由GoReleaser在构建时注入
12+
Version = "dev"
13+
Commit = "unknown"
14+
Date = "unknown"
15+
repoURL = "https://github.com/cursor-home/JG-Cursor-cracker"
1616
)
1717

1818
// versionCmd represents the version command
@@ -23,9 +23,9 @@ var versionCmd = &cobra.Command{
2323
Run: func(cmd *cobra.Command, args []string) {
2424
fmt.Println(utils.BoldCyanText("JG-Cursor-cracker 版本信息"))
2525
fmt.Println(utils.BoldCyanText("-------------------------"))
26-
fmt.Printf("%s: %s\n", utils.BoldGreenText("版本"), utils.WhiteText(version))
27-
fmt.Printf("%s: %s\n", utils.BoldYellowText("提交"), utils.WhiteText(commit))
28-
fmt.Printf("%s: %s\n", utils.BoldMagentaText("构建时间"), utils.WhiteText(buildDate))
26+
fmt.Printf("%s: %s\n", utils.BoldGreenText("版本"), utils.WhiteText(Version))
27+
fmt.Printf("%s: %s\n", utils.BoldYellowText("提交"), utils.WhiteText(Commit))
28+
fmt.Printf("%s: %s\n", utils.BoldMagentaText("构建时间"), utils.WhiteText(Date))
2929
fmt.Printf("%s: %s\n", utils.BoldBlueText("项目地址"), utils.WhiteText(repoURL))
3030
},
3131
}

0 commit comments

Comments
 (0)