build: 优化 Docker/Workflow 构建,使用 Next.js 环境变量注入版本和构建时间,并移除对 package.json 的硬编码替换

This commit is contained in:
ryan
2026-06-11 20:18:49 +08:00
parent 7c125ccef2
commit 50533e1837
11 changed files with 37 additions and 46 deletions
+3 -1
View File
@@ -5,6 +5,8 @@ ARG ALPINE_VERSION=3.23
FROM golang:${GO_VERSION}-alpine AS builder
ARG VERSION=dev
RUN apk add --no-cache ca-certificates git
WORKDIR /workspace
@@ -16,7 +18,7 @@ COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-ldflags="-s -w -X github.com/Rain-kl/Wavelet/internal/cmd.Version=${VERSION}" \
-o /out/wavelet \
./main.go