修复Go版本构建参数

This commit is contained in:
xuans committed 2026-09-24 19:47:52 +08:00
1 parent 2a1da95bfc
commit 3d38f4e3cc
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ try {
$gitHash = (& git rev-parse HEAD).Trim()
if ($LASTEXITCODE -ne 0) { throw '无法读取构建提交信息' }
$buildTime = [DateTime]::UtcNow.ToString('yyyy-MM-ddTHH:mm:ssZ')
$goVersion = (& go version).Trim()
$goVersion = (& go env GOVERSION).Trim()
$flags = "-s -w -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.Version=dev-$($fingerprint.Substring(0, 12))' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GitHash=$gitHash' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.BuildTime=$buildTime' -X 'git.pcux.cn/xuans/Smail/internal/buildinfo.GoVersion=$goVersion'"
& go build -tags bundled -trimpath -ldflags $flags -o (Join-Path $output 'smail.exe') ./cmd/smail
if ($LASTEXITCODE -ne 0) { throw '开发后端构建失败' }