mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-09-20 00:47:57 +00:00
chore: v0.1.1 — 版本号收拢进 internal/version + 发布脚本校验和覆盖安装包
- 新增 internal/version 包作为版本号唯一来源,release.sh 通过 -ldflags -X 注入真实 tag。此前 /api/manager/status 与集群 JoinInfo 里各自硬编码 "0.1.0",产物报告的版本与 tag 无关。 - release.sh:SHA256SUMS 移到原生安装包构建之后统一重算,覆盖 deb/rpm/setup.exe/pkg。此前只算 tar.gz/zip,用户校验安装包会得到 "no file was verified"(v0.1.0 发布时实际踩到)。 - rpm spec / build_installers.sh 默认版本与 changelog、README 安装 示例文件名同步到 0.1.1。 验证:go test ./internal/cluster/... ./internal/httpapi/... 通过; 6 平台产物架构逐个 file 校验正确;linux-amd64 实跑 /status 报告 version=0.1.1(确认 ldflags 注入生效)。
This commit is contained in:
@ -20,6 +20,7 @@ import (
|
||||
"webui4frpc/internal/cluster"
|
||||
"webui4frpc/internal/process"
|
||||
"webui4frpc/internal/store"
|
||||
"webui4frpc/internal/version"
|
||||
)
|
||||
|
||||
//go:embed all:dist
|
||||
@ -413,7 +414,7 @@ func (h *Handler) handleStatus(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
resp := map[string]any{
|
||||
"version": "0.1.0",
|
||||
"version": version.Version,
|
||||
"workDir": h.WorkDir,
|
||||
"settings": settings,
|
||||
"services": locals,
|
||||
|
||||
12
internal/version/version.go
Normal file
12
internal/version/version.go
Normal file
@ -0,0 +1,12 @@
|
||||
// Package version holds the single source of truth for the build version.
|
||||
//
|
||||
// Value is overridable at build time so release artifacts carry the real tag:
|
||||
//
|
||||
// go build -ldflags="-X webui4frpc/internal/version.Version=0.1.1" ./cmd/webui4frpc
|
||||
//
|
||||
// Kept in its own package because both cmd/ and internal/httpapi report it
|
||||
// (main can't be imported, and httpapi must not depend on cmd).
|
||||
package version
|
||||
|
||||
// Version is the running build's semantic version, without a leading "v".
|
||||
var Version = "0.1.1"
|
||||
Reference in New Issue
Block a user