feat: expose build version in public config

- add version to public/admin config responses
- inject build version in Docker and GoReleaser builds
- limit Docker image publishing to v* tags
- restore soft-deleted settings on upsert
This commit is contained in:
line-6000
2026-05-21 19:23:04 +08:00
parent 049a15cb95
commit 85b81e661c
185 changed files with 409 additions and 207 deletions
+8
View File
@@ -484,6 +484,11 @@ func TestGetSupportedAssets_WalletAddressToggle(t *testing.T) {
func TestGetPublicConfig(t *testing.T) {
e := setupTestEnv(t)
oldVersion := config.BuildVersion
config.BuildVersion = "v1.0.1"
t.Cleanup(func() {
config.BuildVersion = oldVersion
})
if err := data.SetSetting(mdb.SettingGroupBrand, mdb.SettingKeyBrandCheckoutName, "asd", mdb.SettingTypeString); err != nil {
t.Fatalf("seed brand.checkout_name: %v", err)
}
@@ -527,6 +532,9 @@ func TestGetPublicConfig(t *testing.T) {
if len(supports) < 2 {
t.Fatalf("expected >= 2 network supports, got %d", len(supports))
}
if respData["version"] != "v1.0.1" {
t.Fatalf("version = %v, want v1.0.1", respData["version"])
}
site, ok := respData["site"].(map[string]interface{})
if !ok {
t.Fatalf("expected site object, got %T", respData["site"])