-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.goreleaser.yml
More file actions
134 lines (117 loc) · 3.15 KB
/
Copy path.goreleaser.yml
File metadata and controls
134 lines (117 loc) · 3.15 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
# GoReleaser 配置文件
# 用于自动化构建和发布多平台可执行文件
version: 2
project_name: xx-cli-to-api-server
# 构建前钩子
before:
hooks:
- bash -c "cd web && npm ci"
- bash -c "cd web && npm run build"
# 构建配置
builds:
- id: xx-cli-to-api-server
main: ./main.go
binary: xx-cli-to-api-server
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
- freebsd
- openbsd
- netbsd
goarch:
- amd64
- arm64
- arm
- 386
goarm:
- "6"
- "7"
ldflags:
- -s -w
- -X 'main.Version={{.Version}}'
- -X 'main.BuildTime={{.Date}}'
- -X 'main.GitCommit={{.Commit}}'
# 存档配置
archives:
- id: default
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
formats:
- tar.gz
- zip
format_overrides:
- goos: windows
formats: [zip]
- goos: darwin
formats: [tar.gz]
- goos: linux
formats: [tar.gz]
# GitHub Release 配置
release:
github:
owner: vibe-coding-labs
name: xx-cli-to-api-server
# Release 标题模板
name_template: "{{ .ProjectName }} {{ .Tag }}"
# Release 说明模板
header: |
## {{ .ProjectName }} {{ .Tag }}
{{ .ReleaseNotes }}
footer: |
## 安装说明
### Linux
```bash
# 下载对应架构的文件
wget https://github.com/vibe-coding-labs/xx-cli-to-api-server/releases/download/{{ .Tag }}/xx-cli-to-api-server_{{ .Version }}_linux_amd64.tar.gz
tar -xzf xx-cli-to-api-server_{{ .Version }}_linux_amd64.tar.gz
chmod +x xx-cli-to-api-server
./xx-cli-to-api-server serve
```
### macOS
```bash
# Intel
wget https://github.com/vibe-coding-labs/xx-cli-to-api-server/releases/download/{{ .Tag }}/xx-cli-to-api-server_{{ .Version }}_darwin_amd64.tar.gz
tar -xzf xx-cli-to-api-server_{{ .Version }}_darwin_amd64.tar.gz
chmod +x xx-cli-to-api-server
./xx-cli-to-api-server serve
# Apple Silicon
wget https://github.com/vibe-coding-labs/xx-cli-to-api-server/releases/download/{{ .Tag }}/xx-cli-to-api-server_{{ .Version }}_darwin_arm64.tar.gz
tar -xzf xx-cli-to-api-server_{{ .Version }}_darwin_arm64.tar.gz
chmod +x xx-cli-to-api-server
./xx-cli-to-api-server serve
```
### Windows
下载 `xx-cli-to-api-server_{{ .Version }}_windows_amd64.zip`,解压后运行 `xx-cli-to-api-server.exe serve`
# Changelog 配置
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
groups:
- title: "功能更新"
regexp: "^feat"
- title: "Bug修复"
regexp: "^fix"
- title: "性能优化"
regexp: "^perf"
- title: "其他变更"
regexp: ".*"
# Snapshot 配置(用于测试)
# snapshot配置已弃用,不再需要
# 校验和配置
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256
# 发布前钩子(可选)
# before:
# hooks:
# - cmd: go test ./...
# 发布后钩子(可选)
# after:
# hooks:
# - cmd: echo "Release {{ .Tag }} published successfully!"