File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 38
38
uses : docker/build-push-action@v2
39
39
with :
40
40
context : .
41
- platforms : linux/amd64,linux/arm64,linux/ arm/v7
41
+ platforms : linux/amd64,linux/arm/v7
42
42
push : true
43
43
tags : |
44
44
${{ secrets.DOCKER_USERNAME }}/channel-monitor:latest
Original file line number Diff line number Diff line change @@ -33,8 +33,12 @@ build() {
33
33
fi
34
34
35
35
echo " Building for ${GOOS} /${GOARCH} ..."
36
- CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -ldflags " ${LDFLAGS} " -o " ${OUTPUT} " .
37
-
36
+ if [ " $GOARCH " = " amd64" ] && [ " $GOOS " = " linux" ]; then
37
+ CGO_ENABLED=1 GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -ldflags " ${LDFLAGS} " -o " ${OUTPUT} " .
38
+ else
39
+ CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH go build -trimpath -ldflags " ${LDFLAGS} " -o " ${OUTPUT} " .
40
+ fi
41
+
38
42
if [ $? -eq 0 ]; then
39
43
echo " ✅ Finished building for ${GOOS} /${GOARCH} "
40
44
# 压缩二进制文件
You can’t perform that action at this time.
0 commit comments