feat: add multi-arch image publishing

This commit is contained in:
zhoujun0601
2026-08-13 11:28:33 -04:00
parent 4fa0a539fa
commit 618fc19bd7
12 changed files with 217 additions and 20 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ func (a *App) api(w http.ResponseWriter, r *http.Request) {
}
}
a.mu.RUnlock()
jsonOut(w, 200, map[string]any{"initialized": a.store.Initialized(), "version": "0.2.0", "appServer": connected})
jsonOut(w, 200, map[string]any{"initialized": a.store.Initialized(), "version": Version, "appServer": connected})
return
}
if p == "setup" && r.Method == "POST" {
+3
View File
@@ -25,6 +25,9 @@ import (
webassets "codex-helper/internal/web"
)
// Version is overridden at build time for release images.
var Version = "0.2.0"
type App struct {
dataDir string
store *store.Store
+22
View File
@@ -23,6 +23,28 @@ func TestSystemStatusRejectsNonGETMethods(t *testing.T) {
}
}
func TestSystemStatusReturnsBuildVersion(t *testing.T) {
a := newReminderTestApp(t)
originalVersion := Version
Version = "1.2.3-test"
t.Cleanup(func() { Version = originalVersion })
recorder := httptest.NewRecorder()
request := httptest.NewRequest(http.MethodGet, "/api/v1/system/status", nil)
a.api(recorder, request)
if recorder.Code != http.StatusOK {
t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String())
}
var body struct {
Version string `json:"version"`
}
if err := json.Unmarshal(recorder.Body.Bytes(), &body); err != nil {
t.Fatal(err)
}
if body.Version != "1.2.3-test" {
t.Fatalf("version = %q; want %q", body.Version, "1.2.3-test")
}
}
func TestDashboardSerializesNilListsAsEmptyArrays(t *testing.T) {
a := newReminderTestApp(t)
a.runtimes[1] = &accountRuntime{}