fix: use underscore in build time to avoid ldflags parsing error

This commit is contained in:
EUForest 2026-01-07 14:27:41 +08:00
parent d3e18af08e
commit 076e5e584b

View File

@ -42,9 +42,8 @@ jobs:
fi
echo "Building ppanel-server $VERSION"
BUILD_TIME=$(date +"%Y-%m-%d %H:%M:%S")
LDFLAGS="-w -s -X github.com/perfect-panel/server/pkg/constant.Version=$VERSION -X github.com/perfect-panel/server/pkg/constant.BuildTime=${BUILD_TIME}"
go build -ldflags "${LDFLAGS}" -o ppanel-server ./ppanel.go
BUILD_TIME=$(date +"%Y-%m-%d_%H:%M:%S")
go build -ldflags="-w -s -X github.com/perfect-panel/server/pkg/constant.Version=$VERSION -X github.com/perfect-panel/server/pkg/constant.BuildTime=$BUILD_TIME" -o ppanel-server ./ppanel.go
tar -czf ppanel-server-${VERSION}-linux-amd64.tar.gz ppanel-server
sha256sum ppanel-server ppanel-server-${VERSION}-linux-amd64.tar.gz > checksum.txt