@@ -6,79 +6,79 @@ before:
66 - go mod tidy
77
88builds :
9- - id : darwin-amd64
9+ - id : chatlog-builds
1010 binary : chatlog
11- env :
12- - CGO_ENABLED=1
13- - CC=o64-clang
14- - CXX=o64-clang++
15- goos :
16- - darwin
17- goarch :
18- - amd64
1911 ldflags :
2012 - -s -w -X github.com/sjzar/chatlog/pkg/version.Version={{.Version}}
21-
22- - id : darwin-arm64
23- binary : chatlog
2413 env :
2514 - CGO_ENABLED=1
26- - CC=oa64-clang
27- - CXX=oa64-clang++
2815 goos :
2916 - darwin
30- goarch :
31- - arm64
32- ldflags :
33- - -s -w -X github.com/sjzar/chatlog/pkg/version.Version={{.Version}}
34-
35- - id : windows-amd64
36- binary : chatlog
37- env :
38- - CGO_ENABLED=1
39- - CC=x86_64-w64-mingw32-gcc
40- - CXX=x86_64-w64-mingw32-g++
41- goos :
4217 - windows
18+ - linux
4319 goarch :
4420 - amd64
45- ldflags :
46- - -s -w -X github.com/sjzar/chatlog/pkg/version.Version={{.Version}}
47-
48- - id : windows-arm64
49- binary : chatlog
50- env :
51- - CGO_ENABLED=1
52- - CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
53- - CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
54- goos :
55- - windows
56- goarch :
5721 - arm64
58- ldflags :
59- - -s -w -X github.com/sjzar/chatlog/pkg/version.Version={{.Version}}
22+ overrides :
23+ - goos : darwin
24+ goarch : amd64
25+ env :
26+ - CGO_ENABLED=1
27+ - CC=o64-clang
28+ - CXX=o64-clang++
29+ - goos : darwin
30+ goarch : arm64
31+ env :
32+ - CGO_ENABLED=1
33+ - CC=oa64-clang
34+ - CXX=oa64-clang++
35+ - goos : windows
36+ goarch : amd64
37+ env :
38+ - CGO_ENABLED=1
39+ - CC=x86_64-w64-mingw32-gcc
40+ - CXX=x86_64-w64-mingw32-g++
41+ - goos : windows
42+ goarch : arm64
43+ env :
44+ - CGO_ENABLED=1
45+ - CC=/llvm-mingw/bin/aarch64-w64-mingw32-gcc
46+ - CXX=/llvm-mingw/bin/aarch64-w64-mingw32-g++
47+ - goos : linux
48+ goarch : amd64
49+ env :
50+ - CGO_ENABLED=1
51+ - CC=x86_64-linux-gnu-gcc
52+ - CXX=x86_64-linux-gnu-g++
53+ - goos : linux
54+ goarch : arm64
55+ env :
56+ - CGO_ENABLED=1
57+ - CC=aarch64-linux-gnu-gcc
58+ - CXX=aarch64-linux-gnu-g++
59+
60+ upx :
61+ - enabled : true
62+ goos : [darwin, windows, linux]
63+ goarch : [amd64, arm64]
64+ compress : best
65+ lzma : true
6066
6167archives :
6268 - id : default
63- format : tar.gz
69+ formats : tar.gz
6470 name_template : >-
6571 {{ .ProjectName }}_
6672 {{- .Version }}_
6773 {{- .Os }}_
6874 {{- .Arch }}
6975 format_overrides :
7076 - goos : windows
71- format : zip
77+ formats : zip
7278 files :
7379 - LICENSE
7480 - README.md
7581
76- upx :
77- - enabled : " {{ .Env.ENABLE_UPX }}"
78- goos : [darwin, windows]
79- goarch : [amd64]
80- compress : best
81-
8282checksum :
8383 name_template : ' checksums.txt'
8484 algorithm : sha256
@@ -88,3 +88,101 @@ release:
8888 draft : true
8989 prerelease : auto
9090 mode : replace
91+
92+ # Docker 镜像配置
93+ dockers :
94+ # GitHub Container Registry
95+ - image_templates :
96+ - " ghcr.io/sjzar/chatlog:{{ .Tag }}-amd64"
97+ - " ghcr.io/sjzar/chatlog:latest-amd64"
98+ dockerfile : Dockerfile
99+ use : buildx
100+ goos : linux
101+ goarch : amd64
102+ build_flag_templates :
103+ - " --platform=linux/amd64"
104+ - " --label=org.opencontainers.image.title={{.ProjectName}}"
105+ - " --label=org.opencontainers.image.description=chat log tool, easily use your own chat data."
106+ - " --label=org.opencontainers.image.url=https://github.com/sjzar/chatlog"
107+ - " --label=org.opencontainers.image.source=https://github.com/sjzar/chatlog"
108+ - " --label=org.opencontainers.image.version={{.Version}}"
109+ - " --label=org.opencontainers.image.created={{.Date}}"
110+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
111+ - " --label=org.opencontainers.image.licenses=Apache-2.0"
112+
113+ - image_templates :
114+ - " ghcr.io/sjzar/chatlog:{{ .Tag }}-arm64"
115+ - " ghcr.io/sjzar/chatlog:latest-arm64"
116+ dockerfile : Dockerfile
117+ use : buildx
118+ goos : linux
119+ goarch : arm64
120+ build_flag_templates :
121+ - " --platform=linux/arm64"
122+ - " --label=org.opencontainers.image.title={{.ProjectName}}"
123+ - " --label=org.opencontainers.image.description=chat log tool, easily use your own chat data."
124+ - " --label=org.opencontainers.image.url=https://github.com/sjzar/chatlog"
125+ - " --label=org.opencontainers.image.source=https://github.com/sjzar/chatlog"
126+ - " --label=org.opencontainers.image.version={{.Version}}"
127+ - " --label=org.opencontainers.image.created={{.Date}}"
128+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
129+ - " --label=org.opencontainers.image.licenses=Apache-2.0"
130+
131+ # Docker Hub
132+ - image_templates :
133+ - " sjzar/chatlog:{{ .Tag }}-amd64"
134+ - " sjzar/chatlog:latest-amd64"
135+ dockerfile : Dockerfile
136+ use : buildx
137+ goos : linux
138+ goarch : amd64
139+ build_flag_templates :
140+ - " --platform=linux/amd64"
141+ - " --label=org.opencontainers.image.title={{.ProjectName}}"
142+ - " --label=org.opencontainers.image.description=chat log tool, easily use your own chat data."
143+ - " --label=org.opencontainers.image.url=https://github.com/sjzar/chatlog"
144+ - " --label=org.opencontainers.image.source=https://github.com/sjzar/chatlog"
145+ - " --label=org.opencontainers.image.version={{.Version}}"
146+ - " --label=org.opencontainers.image.created={{.Date}}"
147+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
148+ - " --label=org.opencontainers.image.licenses=Apache-2.0"
149+
150+ - image_templates :
151+ - " sjzar/chatlog:{{ .Tag }}-arm64"
152+ - " sjzar/chatlog:latest-arm64"
153+ dockerfile : Dockerfile
154+ use : buildx
155+ goos : linux
156+ goarch : arm64
157+ build_flag_templates :
158+ - " --platform=linux/arm64"
159+ - " --label=org.opencontainers.image.title={{.ProjectName}}"
160+ - " --label=org.opencontainers.image.description=chat log tool, easily use your own chat data."
161+ - " --label=org.opencontainers.image.url=https://github.com/sjzar/chatlog"
162+ - " --label=org.opencontainers.image.source=https://github.com/sjzar/chatlog"
163+ - " --label=org.opencontainers.image.version={{.Version}}"
164+ - " --label=org.opencontainers.image.created={{.Date}}"
165+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
166+ - " --label=org.opencontainers.image.licenses=Apache-2.0"
167+
168+ # Docker manifest 配置用于多架构镜像
169+ docker_manifests :
170+ # GitHub Container Registry manifests
171+ - name_template : " ghcr.io/sjzar/chatlog:{{ .Tag }}"
172+ image_templates :
173+ - " ghcr.io/sjzar/chatlog:{{ .Tag }}-amd64"
174+ - " ghcr.io/sjzar/chatlog:{{ .Tag }}-arm64"
175+ - name_template : " ghcr.io/sjzar/chatlog:latest"
176+ image_templates :
177+ - " ghcr.io/sjzar/chatlog:latest-amd64"
178+ - " ghcr.io/sjzar/chatlog:latest-arm64"
179+
180+ # Docker Hub manifests
181+ - name_template : " sjzar/chatlog:{{ .Tag }}"
182+ image_templates :
183+ - " sjzar/chatlog:{{ .Tag }}-amd64"
184+ - " sjzar/chatlog:{{ .Tag }}-arm64"
185+ - name_template : " sjzar/chatlog:latest"
186+ image_templates :
187+ - " sjzar/chatlog:latest-amd64"
188+ - " sjzar/chatlog:latest-arm64"
0 commit comments