Skip to content

Commit 5dd7426

Browse files
committed
docs: 测试构建
1 parent 26d0955 commit 5dd7426

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/conf/.goreleaser.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# GoReleaser v1 配置文件
1+
# GoReleaser v2 配置文件
2+
version: 2
3+
24
project_name: "{{ .Env.PROJECT_NAME }}"
35

46
# 构建前钩子
@@ -37,6 +39,17 @@ builds:
3739
- -X main.date={{ .Date }}
3840
- -X main.builtBy=goreleaser
3941
mod_timestamp: "{{ .CommitTimestamp }}"
42+
hooks:
43+
post:
44+
- cmd: upx --best --lzma {{ .Path }}
45+
filter:
46+
and:
47+
- or:
48+
- goos: windows
49+
- goos: linux
50+
- or:
51+
- goarch: amd64
52+
- goarch: "386"
4053

4154
# 归档配置
4255
archives:
@@ -105,6 +118,6 @@ release:
105118
106119
如有问题请提交 [Issue](https://github.com/{{ .Env.GITHUB_OWNER }}/{{ .Env.GITHUB_REPO }}/issues) 💬
107120
108-
# 快照版本
121+
# 快照版本配置 (修复弃用的name_template)
109122
snapshot:
110-
name_template: "{{ incpatch .Version }}-dev-{{ .ShortCommit }}"
123+
version_template: "{{ incpatch .Version }}-dev-{{ .ShortCommit }}"

0 commit comments

Comments
 (0)