Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

T1f: Windows joins release.yml: built on windows-latest, packed by tools/release.sh, attested, then unzipped on a fresh runner, installed through the published install.ps1 and checked before it's attached. The skills gate reads the private feed app, so a public checkout on any platform takes the commit where it passed from the annotated tag's "skills-passed: <sha>" line (or the skills_passed input) and checks the gate's inputs are unchanged since; without one the release refuses

shinyobjectz4667346f400f
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index db619a37..746f0fc6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,8 +1,12 @@
# A release, built here where anyone can read how (public #6; docs/public-first.feature PF5): for a v* tag, macOS on
-# Apple Silicon and Linux on x86_64 are built from the tag on GitHub's runners, packed by tools/release.sh, checked by
-# tools/release-check.sh, attested (anyone can check a download with
+# Apple Silicon, Linux on x86_64 and Windows on x86_64 are built from the tag on GitHub's runners, packed by
+# tools/release.sh, checked by tools/release-check.sh, attested (anyone can check a download with
# `gh attestation verify raea-VERSION-macos-arm64.tar.gz -R shinyobjectz/raea`) and attached to the tag's release.
-# Windows builds in windows.yml's release mode. The release's notes and whether it's a pre-release are set by hand.
+# The skills gate reads the feed app, which is private, so it runs in a maintainer's checkout first
+# (tools/skills.sh check), and the tag names the commit it passed on; tools/release.sh checks the gate's inputs haven't
+# changed since (tools/release/skills-passed.sh):
+# git tag -a v0.1.0-canary.4 -m "raea 0.1.0-canary.4" -m "skills-passed: <full sha>"
+# The release's notes and whether it's a pre-release are set by hand.
name: release
on:
@@ -14,6 +18,10 @@ on:
description: the tag to build (v0.1.0-canary.4)
required: true
type: string
+ skills_passed:
+ description: the full SHA where tools/skills.sh check passed with the feed app (else the tag's skills-passed line)
+ default: ""
+ type: string
permissions:
contents: write
@@ -75,6 +83,8 @@ jobs:
mkdir ship
cp target/dist/raea target/dist/${{ matrix.lib }} target/dist/raea-rune-host target/dist/raea-page-host ship/
if [ -n "${{ matrix.extra }}" ]; then cp target/dist/${{ matrix.extra }} ship/; fi
+ - name: Where the skills gate passed
+ run: bash tools/release/skills-passed.sh "$TAG" "${{ inputs.skills_passed }}"
- name: Pack and check (tools/release.sh)
run: |
v=${TAG#v}
@@ -89,3 +99,126 @@ jobs:
run: |
gh release view "$TAG" >/dev/null 2>&1 || gh release create "$TAG" --prerelease --title "raea ${TAG#v}" --notes "Built by .github/workflows/release.yml; notes follow."
gh release upload "$TAG" dist/raea-*.tar.gz dist/raea-*.tar.gz.sha256 --clobber
+
+ # Windows in Git's bash on GitHub's runner, with the Visual Studio Build Tools in its image (their image terms; we
+ # accept no licence and download no Microsoft files). The C runtime is the DLL one (the VC++ redistributable): ort's
+ # prebuilt ONNX Runtime is built against it, so crt-static doesn't link (LNK2019 on __imp_ symbols, 10-29).
+ windows:
+ runs-on: windows-latest
+ timeout-minutes: 350
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ env.TAG }}
+ submodules: true
+ lfs: false
+ - name: Toolchain (rust-toolchain.toml's pin)
+ run: rustup show active-toolchain || rustup toolchain install
+ # jq for Windows ends -r lines with CRLF, so tools/bevy-plugins.sh read "ahoy\r" and lost its Bevy 0.20 block
+ # (feature `ahoy` not found, 11-04); -b writes LF
+ - name: jq that writes LF
+ run: |
+ mkdir -p "$RUNNER_TEMP/jq"
+ printf '#!/bin/bash\nexec "%s" -b "$@"\n' "$(command -v jq)" > "$RUNNER_TEMP/jq/jq"
+ chmod +x "$RUNNER_TEMP/jq/jq"
+ echo "$RUNNER_TEMP/jq" >> "$GITHUB_PATH"
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: 1.4.2
+ - name: The runtime's packages
+ run: for d in sdk/react/js sdk/react/tw; do (cd "$d" && bun install --frozen-lockfile); done
+ # the app targets' hosts a cargo call each: with raea-cli's crates in one call taffy's features unify and
+ # rune-taffy doesn't build
+ - name: Build
+ run: |
+ feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
+ cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
+ cargo build --profile dist --locked -p raea-rune-host
+ cargo build --profile dist --locked -p raea-page-host --features window
+ # which DLLs raea needs from the machine (the CRT's come from the VC++ redistributable)
+ - name: What raea.exe imports
+ run: |
+ { echo '### what raea.exe and raea_bundle.dll import'; echo '```'
+ dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe | head -1)
+ "$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
+ echo '```'; } | tee -a "$GITHUB_STEP_SUMMARY" || true
+ # release.sh's checks render on Mesa's lavapipe (software Vulkan, MIT; on the runner only, never in the zip): the
+ # runner has no GPU, and WARP, Windows' own software DX12, crashes compiling one of Bevy's compute shaders there
+ # (d3d10warp ComputeShaderTransformer::ConstructLoadStoreSets, an access violation; 11-04)
+ - name: Software Vulkan
+ run: bash tools/release/lavapipe.sh
+ - name: Where the skills gate passed
+ run: bash tools/release/skills-passed.sh "$TAG" "${{ inputs.skills_passed }}"
+ - name: Pack and check (tools/release.sh)
+ run: bash tools/release.sh "${TAG#v}" target/dist HEAD
+ - uses: actions/attest-build-provenance@v2
+ with:
+ subject-path: dist/raea-*.zip
+ - uses: actions/upload-artifact@v4
+ with:
+ name: windows-zip
+ path: dist/raea-*.zip*
+ retention-days: 7
+ compression-level: 0
+
+ # the zip alone, on a runner that never had raea's sources, as a user's machine gets it; it also tests the
+ # published installer (raea.io/install.ps1), pointed at the zip by RAEA_DOWNLOAD. Only a zip that passes is attached.
+ windows-verify:
+ needs: windows
+ runs-on: windows-latest
+ timeout-minutes: 20
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ env.TAG }}
+ lfs: false
+ sparse-checkout: |
+ tools/release-check.sh
+ tools/release/lavapipe.sh
+ sparse-checkout-cone-mode: false
+ path: check
+ - uses: actions/download-artifact@v4
+ with:
+ name: windows-zip
+ path: ${{ runner.temp }}/zip
+ - name: Software Vulkan
+ run: bash check/tools/release/lavapipe.sh
+ - name: The zip, unpacked and checked
+ run: |
+ set -e
+ v=${TAG#v}
+ cp check/tools/release-check.sh "$RUNNER_TEMP/"
+ rm -rf check
+ cd "$RUNNER_TEMP/zip"
+ sha256sum -c "raea-$v-windows-x86_64.zip.sha256"
+ bash "$RUNNER_TEMP/release-check.sh" "$PWD/raea-$v-windows-x86_64.zip" | tee -a "$GITHUB_STEP_SUMMARY"
+ - name: install.ps1, then a render from PATH
+ shell: pwsh
+ run: |
+ $v = $env:TAG.Substring(1)
+ $rel = Join-Path $env:RUNNER_TEMP "rel"
+ New-Item -ItemType Directory -Force -Path (Join-Path $rel "v$v") | Out-Null
+ Copy-Item (Join-Path $env:RUNNER_TEMP "zip/raea-$v-windows-x86_64.zip*") (Join-Path $rel "v$v")
+ $env:RAEA_DOWNLOAD = $rel; $env:RAEA_VERSION = $v; $env:RAEA_NO_SKILLS = "1"
+ & ([scriptblock]::Create((Invoke-RestMethod https://raea.io/install.ps1)))
+ $p = Join-Path $env:RUNNER_TEMP "user"; New-Item -ItemType Directory -Force -Path $p | Out-Null; Set-Location $p
+ $env:RAEA_NO_TREE = "1"; $env:RAEA_API = "http://127.0.0.1:9"
+ raea init
+ if ($LASTEXITCODE) { throw "raea init failed" }
+ Set-Content hello.tsx 'import { AbsoluteFill, Composition, registerRoot } from "raea"; registerRoot(() => <Composition id="hello" component={() => <AbsoluteFill style={{ background: "#123", color: "#fff", fontSize: 90, justifyContent: "center", alignItems: "center" }}>raea on Windows</AbsoluteFill>} width={640} height={360} fps={30} durationInFrames={30} />);'
+ $h = Join-Path $env:RUNNER_TEMP "hello"; New-Item -ItemType Directory -Force -Path $h | Out-Null; Move-Item hello.tsx $h; Set-Location $h
+ raea render hello.tsx --frame 1 -o hello.png
+ if ($LASTEXITCODE -or -not (Test-Path hello.png)) { throw "raea render failed" }
+ Get-Item hello.png | Format-List Name, Length
+ - name: Attach to the release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ gh release view "$TAG" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1 || gh release create "$TAG" -R "$GITHUB_REPOSITORY" --prerelease --title "raea ${TAG#v}" --notes "Built by .github/workflows/release.yml; notes follow."
+ gh release upload "$TAG" -R "$GITHUB_REPOSITORY" "$RUNNER_TEMP"/zip/raea-*.zip "$RUNNER_TEMP"/zip/raea-*.zip.sha256 --clobber
diff --git a/tools/release-check.sh b/tools/release-check.sh
index d6624b16..9f51223a 100644
--- a/tools/release-check.sh
+++ b/tools/release-check.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-# The check every release archive passes (tools/release.sh runs it on the archive it just made; windows.yml's verify job
-# runs it again on a fresh Windows runner, from the archive alone): unpacked into a fresh folder, with RAEA_NO_TREE=1 so
-# it can't be reading a checkout, its raea renders a frame, has the plugin catalog, prints a craft guide and writes
-# styles.gen.ts; its binaries name none of raea's API, nothing in it looks like a key, and a Windows archive holds no
-# Microsoft file (the CRT comes from the VC++ redistributable; docs/handoff/ports.md).
+# The check every release archive passes (tools/release.sh runs it on the archive it just made; release.yml's
+# windows-verify job runs it again on a fresh Windows runner, from the archive alone): unpacked into a fresh folder,
+# with RAEA_NO_TREE=1 so it can't be reading a checkout, its raea renders a frame, has the plugin catalog, prints a
+# craft guide and writes styles.gen.ts; its binaries name none of raea's API, nothing in it looks like a key, and a
+# Windows archive holds no Microsoft file (the CRT comes from the VC++ redistributable; docs/handoff/ports.md).
#
# tools/release-check.sh ARCHIVE raea-VERSION-PLATFORM.tar.gz or .zip
set -eu
diff --git a/tools/release.sh b/tools/release.sh
index 9bc85613..57f350f6 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -1,11 +1,10 @@
#!/bin/bash
# A release of the raea engine for macOS on Apple Silicon, Linux on x86_64 or Windows on x86_64 (whichever machine runs
-# it; Linux's is built on the probe box in an ubuntu:24.04 root, for glibc 2.39; Windows's on GitHub's windows-latest
-# runner, .github/workflows/windows.yml's release mode, in Git's bash): raea and its bundler, with raea's own files
-# beside them (share/raea: the raea SDK's TypeScript, the lite runtime and its packages, the shell's sources, the tools
-# that install the local music and foley models, and the agent skills), laid out as the installer puts it under
-# ~/.raea. Built from the committed tree at REF (never anyone's unfinished edit); the runtime's packages
-# (sdk/react/js/node_modules, installed, not committed) come from this checkout.
+# it; .github/workflows/release.yml builds all three on GitHub's runners for a tag, Windows in Git's bash): raea and
+# its bundler, with raea's own files beside them (share/raea: the raea SDK's TypeScript, the lite runtime and its
+# packages, the shell's sources, the tools that install the local music and foley models, and the agent skills), laid
+# out as the installer puts it under ~/.raea. Built from the committed tree at REF (never anyone's unfinished edit);
+# the runtime's packages (sdk/react/js/node_modules, installed, not committed) come from this checkout.
#
# tools/release.sh VERSION BIN_DIR [REF] BIN_DIR holds a release build's raea and its bundler
# (libraea_bundle.dylib, .so, or raea.exe and raea_bundle.dll), and on
@@ -60,11 +59,14 @@ untar() {
return $rc
}
raea_bin=$bin/raea; [ -f "$raea_bin.exe" ] && raea_bin=$raea_bin.exe
-# The gate reads the feed app's checkout (apps/app), a private submodule GitHub's Windows runner can't fetch. There,
-# RAEA_SKILLS_PASSED=SHA stands for it: the gate passed at SHA on macOS or Linux, and it counts for REF only when what
-# the gate reads (the skills and guides, the glossary, the CLI's usage, skills.sh) is the same at both (T1f, 11-07)
+# The gate reads the feed app's checkout (apps/app), which is private: a public checkout (release.yml's runners) has
+# none. There, RAEA_SKILLS_PASSED=SHA stands for it: the gate passed at SHA where the feed app is (a maintainer's
+# checkout), and it counts for REF only when what the gate reads (the skills and guides, the glossary, the CLI's usage,
+# skills.sh) is the same at both. With neither, the release refuses (T1f, 11-07)
gate_inputs=(sdk/skills sdk/guides docs/skills.glossary.md engine/cli/src tools/skills.sh)
-if [ "$platform" = windows-x86_64 ] && [ ! -f "$root/apps/app/src/acp/protocol.ts" ] && [ -n "${RAEA_SKILLS_PASSED:-}" ]; then
+if [ ! -f "$root/apps/app/src/acp/protocol.ts" ]; then
+ [ -n "${RAEA_SKILLS_PASSED:-}" ] || { echo "release.sh: no feed app here (apps/app), so the skills gate can't run; run tools/skills.sh check in a checkout with the feed app, then name the commit it passed on as RAEA_SKILLS_PASSED (release.yml: a \"skills-passed: <sha>\" line in the annotated tag's message, or the skills_passed input when run by hand)" >&2; exit 1; }
+ git rev-parse -q --verify "$RAEA_SKILLS_PASSED^{commit}" >/dev/null || { echo "release.sh: RAEA_SKILLS_PASSED=$RAEA_SKILLS_PASSED isn't a commit here (a full SHA, fetched)" >&2; exit 1; }
git diff --quiet "$RAEA_SKILLS_PASSED" "$ref" -- "${gate_inputs[@]}" \
|| { echo "release.sh: the skills changed between $RAEA_SKILLS_PASSED (where the gate passed) and $ref" >&2; exit 1; }
echo "release.sh: note: the skills gate passed at $(git rev-parse --short "$RAEA_SKILLS_PASSED") elsewhere and its inputs are unchanged; not run here (no feed app)"
diff --git a/tools/release/lavapipe.sh b/tools/release/lavapipe.sh
new file mode 100755
index 00000000..5fbb8f6f
--- /dev/null
+++ b/tools/release/lavapipe.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# Mesa's lavapipe 26.2.4 (software Vulkan, MIT) on a Windows runner, for release checks that render: the runner has no
+# GPU, and WARP crashes compiling one of Bevy's compute shaders (11-04). On the runner only, never in a zip.
+set -euo pipefail
+mkdir -p "$RUNNER_TEMP/mesa" && cd "$RUNNER_TEMP/mesa"
+curl -fsSL -o mesa.7z https://github.com/pal1000/mesa-dist-win/releases/download/26.2.4/mesa3d-26.2.4-release-msvc.7z
+7z x -y mesa.7z x64/vulkan_lvp.dll x64/lvp_icd.x86_64.json >/dev/null
+icd=$(cygpath -w "$RUNNER_TEMP/mesa/x64/lvp_icd.x86_64.json")
+# the runner's shell is elevated, and the Vulkan loader ignores VK_DRIVER_FILES for an elevated process: the driver is
+# registered where an installed one is
+pwsh -c "New-Item -Path HKLM:\\SOFTWARE\\Khronos\\Vulkan\\Drivers -Force | Out-Null; New-ItemProperty -Path HKLM:\\SOFTWARE\\Khronos\\Vulkan\\Drivers -Name '$icd' -PropertyType DWord -Value 0 -Force | Out-Null"
+{ echo "WGPU_BACKEND=vulkan"; echo "VK_LOADER_DEBUG=error,driver"; } >> "$GITHUB_ENV"
diff --git a/tools/release/skills-passed.sh b/tools/release/skills-passed.sh
new file mode 100755
index 00000000..88d1e289
--- /dev/null
+++ b/tools/release/skills-passed.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Where release.yml's skills gate passed (T1f, 11-07): the commit tools/release.sh takes as RAEA_SKILLS_PASSED, since a
+# public checkout has no feed app to run the gate with. It's the skills_passed input when the workflow is run by hand,
+# else the annotated tag's "skills-passed: <sha>" line; with neither, the release refuses. The commit is fetched so
+# release.sh can compare the gate's inputs, and written to GITHUB_ENV (or printed, off Actions).
+# tools/release/skills-passed.sh TAG [SHA]
+set -euo pipefail
+tag=${1:?tag}
+sha=${2:-}
+if [ -z "$sha" ]; then
+ git fetch -q --depth=1 origin "refs/tags/$tag:refs/tags/$tag" 2>/dev/null || true
+ [ "$(git cat-file -t "refs/tags/$tag" 2>/dev/null)" = tag ] ||
+ { echo "skills-passed: $tag isn't an annotated tag, so it can't say where the skills gate passed (tag with -a and a \"skills-passed: <sha>\" line, or run release.yml by hand with skills_passed)" >&2; exit 1; }
+ sha=$(git for-each-ref --format='%(contents)' "refs/tags/$tag" | sed -nE 's/^skills-passed: *([0-9a-f]{40}) *$/\1/p' | head -1)
+ [ -n "$sha" ] || { echo "skills-passed: $tag's message has no \"skills-passed: <sha>\" line (a full SHA where tools/skills.sh check passed with the feed app)" >&2; exit 1; }
+fi
+[[ $sha =~ ^[0-9a-f]{40}$ ]] || { echo "skills-passed: $sha isn't a full commit SHA" >&2; exit 1; }
+git cat-file -e "$sha^{commit}" 2>/dev/null || git fetch -q --depth=1 origin "$sha"
+echo "skills-passed: the gate passed at $sha"
+if [ -n "${GITHUB_ENV:-}" ]; then echo "RAEA_SKILLS_PASSED=$sha" >> "$GITHUB_ENV"; else echo "RAEA_SKILLS_PASSED=$sha"; fi