mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-29 16:54:41 +00:00
Add versioning support to build artifacts and log outputs
- Introduced `Version` variable, set during build via `-ldflags`, to embed application version. - Updated Dockerfile to accept `APP_VERSION` argument for version injection during build. - Modified `.goreleaser.yml` to pass GitHub release tag as version via `ldflags`. - Added version logging in the application startup.
This commit is contained in:
@@ -8,7 +8,9 @@ RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o ./CLIProxyAPI ./cmd/server/
|
||||
ARG APP_VERSION="dev"
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X 'main.Version=${APP_VERSION}'" -o ./CLIProxyAPI ./cmd/server/
|
||||
|
||||
FROM alpine:3.22.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user