From d3e18af08ed1bc7ac5e9c3e433cc05ff4e39632c Mon Sep 17 00:00:00 2001 From: EUForest Date: Wed, 7 Jan 2026 14:25:55 +0800 Subject: [PATCH] fix: correct ldflags for version and build time --- .github/workflows/deploy-linux.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-linux.yml b/.github/workflows/deploy-linux.yml index f3c5e53..3f797c5 100644 --- a/.github/workflows/deploy-linux.yml +++ b/.github/workflows/deploy-linux.yml @@ -42,7 +42,9 @@ jobs: fi echo "Building ppanel-server $VERSION" - go build -ldflags "-s -w -X main.Version=$VERSION" -o ppanel-server ./ppanel.go + 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 tar -czf ppanel-server-${VERSION}-linux-amd64.tar.gz ppanel-server sha256sum ppanel-server ppanel-server-${VERSION}-linux-amd64.tar.gz > checksum.txt