build: 注入 patched CPA 版本信息
This commit is contained in:
+9
-1
@@ -84,7 +84,15 @@ git -C .externals/CLIProxyAPI apply ../../patch/cli-proxy-api-request-lifecycle-
|
||||
cd .externals/CLIProxyAPI
|
||||
gofmt -w internal/pluginhost sdk/api/handlers sdk/cliproxy/usage sdk/pluginabi sdk/pluginapi
|
||||
go test -race ./internal/pluginhost ./sdk/api/handlers ./sdk/cliproxy/usage -count=1
|
||||
CGO_ENABLED=1 go build -o test-output ./cmd/server
|
||||
version=v7.2.133-dev
|
||||
commit=7efe0a7c
|
||||
build_date="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
CGO_ENABLED=1 go build -buildvcs=false \
|
||||
-ldflags="-s -w -X main.Version=$version -X main.Commit=$commit -X main.BuildDate=$build_date" \
|
||||
-o test-output ./cmd/server
|
||||
help_output="$(./test-output -h 2>&1)"
|
||||
first_line="${help_output%%$'\n'*}"
|
||||
test "$first_line" = "CLIProxyAPI Version: $version, Commit: $commit, BuiltAt: $build_date"
|
||||
rm test-output
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user