Commit68dacdb3Recorded1 Jun 2026Repositoryblackice

Use generated web artifacts for blackICE workflow

Changed
 Makefile           |  2 +-
 README.md          | 15 ++++++++-------
 docs/publishing.md | 15 +++++++--------
 publish.sh         | 18 +++++++-----------
 4 files changed, 23 insertions(+), 27 deletions(-)
Diff
Makefilemodified
@@ -24,7 +24,7 @@ build:
24
run: build serve
25
26
serve:
27
PORT=$(PORT) node dev-server.js
+27
$(SHELL_RUN) $(SIGIL) serve --dir build/web --port $(PORT)
28
29
publish:
30
./publish.sh
README.mdmodified
@@ -45,20 +45,21 @@ the live monorepo tree via redirects (not a tagged release):
45
```bash
46
guix shell -m ../sigil/manifest.scm -- \
47
../sigil/build/dev/bin/sigil build --config web \
48
--redirects ./dev-redirects.sgl --no-bundle
+48
--redirects ./dev-redirects.sgl
49
```
50
51
Output lands in `build/web/` (`blackice.wasm` + bridge assets + the WASI `lib/`
52
tree). If you rebuild the dev sigil, `rm -rf build` first — the incremental cache
53
does not invalidate on a compiler change (see the report, F8).
+51
Output lands in `build/web/` (`index.html`, `blackice.wasm`, bridge assets, and
+52
the bundled WASI library files). If you rebuild the dev sigil, `rm -rf build`
+53
first. The incremental cache does not invalidate on a compiler change (see the
+54
report, F8).
55
56
## Run
57
57
Serve the repo root over HTTP (the browser fetches the wasm + lib files; `file://`
58
won't work) and open it:
+58
Serve the generated web output over HTTP (`file://` won't work) and open it:
59
60
```bash
61
node dev-server.js # http://127.0.0.1:8770/ (any static server works)
+61
guix shell -m ../sigil/manifest.scm -- \
+62
../sigil/build/dev/bin/sigil serve --dir build/web
63
```
64
65
## Levels
docs/publishing.mdmodified
@@ -38,9 +38,9 @@ make deploy # build + stage + push (== ./publish.sh --push)
38
```
39
40
`publish.sh` (see flags inside) builds the wasm, then assembles a clean orphan
41
`pages` branch containing only the deployable files (`index.html`, `styles.css`,
42
`web/`, `build/web/`, a `404.html` fallback) via a throwaway git worktree, commits
43
it tagged with the source SHA, and optionally pushes. The source branch history
+41
`pages` branch containing only the generated `build/web/` site plus a `404.html`
+42
fallback via a throwaway git worktree, commits it tagged with the source SHA,
+43
and optionally pushes. The source branch history
44
stays free of build artifacts.
45
46
Flags: `./publish.sh --no-build` reuses the existing `build/web/`;
@@ -50,9 +50,8 @@ Flags: `./publish.sh --no-build` reuses the existing `build/web/`;
50
51
- The whole site is relative-path, so it works under the `/blackice/` subpath
52
without configuration.
53
- The committed build is ~25 MB (1.9 MB wasm + ~3.9 MB WASI lib tree + bridge
54
assets, plus docs). It lives only on the `pages` branch, never on source
55
branches. If the `pages` branch history grows unwieldy, squash it periodically
56
(it is a deploy artifact, not source history).
57
- Rebuild reminder: if the dev sigil is rebuilt, `make clean` first — the
+53
- The committed build lives only on the `pages` branch, never on source branches.
+54
If the `pages` branch history grows unwieldy, squash it periodically (it is a
+55
deploy artifact, not source history).
+56
- Rebuild reminder: if the dev sigil is rebuilt, `make clean` first. The
57
incremental cache can serve stale bytecode (see `wasm-bridge-report.md` F8).
publish.shmodified
@@ -5,9 +5,8 @@
5
#
6
# Codeberg serves the `pages` branch of a repo at
7
# https://<owner>.codeberg.page/<repo>/. We keep that branch as an orphan
8
# branch containing ONLY the deployable static site (index.html, styles.css,
9
# web/, and the built build/web/ wasm + bridge assets), so the source history
10
# on the feature/master branch stays clean.
+8
# branch containing ONLY the generated static site from build/web/, so the
+9
# source history on the feature/master branch stays clean.
10
#
11
# Usage:
12
# ./publish.sh # build + stage + commit to the pages branch
@@ -73,19 +72,16 @@ fi
72
73
# --- 3. assemble the deployable site --------------------------------------
74
echo "==> staging site into $PAGES_BRANCH"
76
# Wipe tracked files (keep .git), then copy the deploy set preserving paths so
77
# index.html's relative refs (styles.css, web/, build/web/) resolve unchanged.
+75
# Wipe tracked files (keep .git), then copy the generated deploy set. The web
+76
# build emits index.html, styles.css, assets/, wasm, bridge files, and lib.bundle
+77
# with relative refs that resolve from the output root.
78
find "$PAGES_WORKTREE" -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
79
80
cp index.html styles.css "$PAGES_WORKTREE/"
81
mkdir -p "$PAGES_WORKTREE/web"
82
cp web/sigil-web-app.js "$PAGES_WORKTREE/web/"
83
mkdir -p "$PAGES_WORKTREE/build"
84
cp -r build/web "$PAGES_WORKTREE/build/web"
+80
cp -R build/web/. "$PAGES_WORKTREE/"
81
82
# Codeberg Pages: an empty .domains is unnecessary; a 404 fallback is nice to
83
# have so unknown paths still land on the game.
88
cp index.html "$PAGES_WORKTREE/404.html"
+84
cp build/web/index.html "$PAGES_WORKTREE/404.html"
85
86
# --- 4. commit ------------------------------------------------------------
87
SRC_SHA="$(git rev-parse --short HEAD)"