Files
aego/tools/gendocs/site/build_identity.go
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

79 lines
2.2 KiB
Go

package site
import (
"crypto/sha256"
hexenc "encoding/hex"
"encoding/json"
"os"
"path/filepath"
)
func digest(data []byte) string {
h := sha256.Sum256(data)
return hexenc.EncodeToString(h[:])
}
func (b *builder) docsVersion() string {
v := b.opt.Version
if v == "" {
v = "unversioned"
}
channel := b.opt.Channel
if channel == "" {
channel = "development"
}
return "Aego " + v + " · " + channel
}
func (b *builder) markdownBuildNote() string {
return "> " + b.docsVersion() + "; docs build `" + b.buildID + "`. [Build manifest](/docs-build.json)."
}
// identifyBuild fingerprints the registry snapshot and presentation inputs.
// This is a documentation build identity, not a Git commit or worktree hash.
func (b *builder) identifyBuild() error {
registry, err := json.Marshal(b.exp)
if err != nil {
return err
}
b.registrySHA = digest(registry)
inputs, err := json.Marshal(struct {
Registry, Assets, Layout string
Options Options
}{b.registrySHA, b.assetV, digest([]byte(layoutSrc)), b.opt})
if err != nil {
return err
}
b.buildID = digest(inputs)
return nil
}
func (b *builder) writeBuildManifest() error {
pages := make(map[string]string, len(b.order))
for _, id := range b.order {
pages[id] = cleanURL(b.urls[id])
}
data, err := json.MarshalIndent(struct {
Schema int `json:"schema"`
BuildID string `json:"buildID"`
RegistrySHA256 string `json:"registrySHA256"`
Version string `json:"version"`
Commit string `json:"commit"`
IdentityScope string `json:"identityScope"`
Pages map[string]string `json:"pages"`
}{1, b.buildID, b.registrySHA, b.docsVersion(), b.opt.Commit,
"Registry snapshot and presentation inputs; not a Git worktree fingerprint or runtime acceptance result.", pages}, "", " ")
if err != nil {
return err
}
// This is the same registry snapshot the HTML/Markdown/search renderer used.
registry, err := json.Marshal(b.exp)
if err != nil {
return err
}
if err := os.WriteFile(filepath.Join(b.out, "docs-registry.json"), registry, 0o644); err != nil {
return err
}
return os.WriteFile(filepath.Join(b.out, "docs-build.json"), append(data, '\n'), 0o644)
}