-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
185 lines (151 loc) · 3.76 KB
/
.goreleaser.yaml
File metadata and controls
185 lines (151 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# GoReleaser 配置文件
# 用于 qoder-logout 项目的自动化构建和发布
# 配置文件版本
version: 2
# 项目基本信息
project_name: qoder-logout
# 构建配置
builds:
- id: qoder-logout
# 主文件
main: ./main.go
# 二进制文件名
binary: qoder-logout
# 环境变量
env:
- CGO_ENABLED=1
# 支持的平台
goos:
- linux
- darwin
goarch:
- amd64
- arm64
# 编译标志
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X main.builtBy=goreleaser
# 编译标签
tags:
- sqlite_omit_load_extension
# 输出格式
# 构建后钩子
hooks:
post:
- cmd: echo "构建完成:{{ .Path }}"
# Windows 平台单独构建(禁用 CGO)
- id: qoder-logout-windows
main: ./main.go
binary: qoder-logout
env:
- CGO_ENABLED=0 # Windows 平台禁用 CGO
goos:
- windows
goarch:
- amd64
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
- -X main.builtBy=goreleaser
# 不使用 sqlite 标签,因为禁用了 CGO
hooks:
post:
- cmd: echo "构建完成:{{ .Path }}"
# 归档配置
archives:
- id: default
# 归档文件名格式
name_template: >-
{{- .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# 包含的文件
files:
- README.md
- LICENSE*
- CHANGELOG.md
- ARCHITECTURE.md
# Checksum 文件生成
checksum:
name_template: 'checksums.txt'
algorithm: sha256
# 快照配置
snapshot:
version_template: "{{ .Tag }}-next"
# 更新日志配置
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^ci:'
- '^chore:'
- '^style:'
- Merge pull request
- Merge branch
groups:
- title: '新功能'
regexp: '^.*?feat(\(.+\))??!?:.+$'
order: 0
- title: '问题修复'
regexp: '^.*?fix(\(.+\))??!?:.+$'
order: 1
- title: '性能优化'
regexp: '^.*?perf(\(.+\))??!?:.+$'
order: 2
- title: '其他变更'
order: 999
# GitHub Releases 配置
release:
# 发布到 GitHub
github:
owner: ai-coding-labs
name: qoder-logout
# 草稿模式(设为 false 自动发布)
draft: false
# 预发布模式
prerelease: auto
# 发布说明模板
header: |
## qoder-logout {{.Tag}} 发布说明
感谢使用 qoder-logout!这个版本包含以下更新:
footer: |
## 安装说明
### 二进制文件下载
请根据你的操作系统下载对应的二进制文件:
- **macOS (Intel)**: qoder-logout_Darwin_x86_64.tar.gz
- **macOS (Apple Silicon)**: qoder-logout_Darwin_arm64.tar.gz
- **Linux (x86_64)**: qoder-logout_Linux_x86_64.tar.gz
- **Windows (x86_64)**: qoder-logout_Windows_x86_64.zip
### 验证下载
你可以使用 checksums.txt 文件验证下载的完整性:
```bash
sha256sum -c checksums.txt
```
### 快速安装
```bash
# 下载并解压
curl -L https://github.com/ai-coding-labs/qoder-logout/releases/download/{{.Tag}}/qoder-logout_$(uname -s)_$(uname -m).tar.gz | tar xz
# 移动到系统路径
sudo mv qoder-logout /usr/local/bin/
# 验证安装
qoder-logout --version
```
# 发布前检查
before:
hooks:
- go mod tidy
- go test ./...
# 元数据
metadata:
mod_timestamp: '{{ .CommitTimestamp }}'