Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 192 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Builds Frame Studio for every computer it runs on, and the Frame Home installer, on every push (any branch or tag),
# every pull request, and by hand (Actions > build > Run workflow). Each build is a downloadable artifact of the run.
# A push to main also replaces the "latest" pre-release with them (one place to download the newest of everything);
# a tag "v*" publishes them as that version's release.
# Builds Frame Studio for every computer it runs on, plus a same-commit Frame Home payload, on branch pushes,
# pull requests, and by hand (Actions > build > Run workflow). A push to main replaces the Studio "latest" pre-release
# and includes the Frame Home installer. A tag "v*" publishes a versioned release containing both products.
name: build

on:
push:
branches: ['**']
tags: ['v*']
pull_request:
workflow_dispatch:

permissions:
contents: read

# A newer push to the same branch replaces a run still going (its builds would be out of date anyway).
concurrency:
group: build-${{ github.ref }}
Expand All @@ -17,10 +21,12 @@ concurrency:
# Every Studio build knows the commit it's from (studio/updater.h compares it with the latest release's).
env:
FRAME_BUILD: ${{ github.sha }}
FRAME_HOME_PAYLOAD_DIR: ${{ github.workspace }}/build/frame-home/payload

jobs:
linux:
name: Linux ${{ matrix.arch }}
needs: [frame-home]
strategy:
fail-fast: false
matrix:
Expand All @@ -31,31 +37,68 @@ jobs:
- { arch: arm64, runner: ubuntu-24.04-arm, extra: "" }
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
env:
FRAME_USE_CCACHE: "1"
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
CCACHE_COMPILERCHECK: content
APT_CACHE_DIR: ${{ github.workspace }}/.apt-cache
steps:
- uses: actions/checkout@v4
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/.ccache
key: ccache-studio-linux-${{ matrix.arch }}-${{ github.sha }}
restore-keys: ccache-studio-linux-${{ matrix.arch }}-
- name: Restore apt package cache
uses: actions/cache@v5
with:
path: .apt-cache/archives
key: apt-ubuntu-24.04-${{ matrix.arch }}-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: apt-ubuntu-24.04-${{ matrix.arch }}-
- name: Download Frame Home payload
uses: actions/download-artifact@v4
with:
name: FrameHome-payload
path: build/frame-home/payload
- name: Tools and X11 headers
run: |
# x86 links against 32-bit X11, so apt needs the i386 packages too
if [ "${{ matrix.i386 }}" = "true" ]; then sudo dpkg --add-architecture i386; fi
sudo mkdir -p "$APT_CACHE_DIR/archives/partial"
sudo chown _apt:root "$APT_CACHE_DIR/archives/partial"
sudo apt-get update
sudo apt-get install -y ninja-build cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxkbcommon-dev ${{ matrix.extra }}
sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache ninja-build cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxkbcommon-dev ${{ matrix.extra }}
sudo chown -R "$(id -u):$(id -g)" "$APT_CACHE_DIR/archives"
- name: Build
run: sh scripts/build-studio.sh linux-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
- name: Show compiler cache statistics
run: ccache --show-stats
- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: FrameStudio-linux-${{ matrix.arch }}
path: dist/FrameStudio-linux-${{ matrix.arch }}.tar.gz
path: build/stage/FrameStudio-linux-${{ matrix.arch }}

windows:
name: Windows ${{ matrix.arch }}
needs: [frame-home]
strategy:
fail-fast: false
matrix:
arch: [x64, x86, arm64]
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Check out source
uses: actions/checkout@v4
- name: Download Frame Home payload
uses: actions/download-artifact@v4
with:
name: FrameHome-payload
path: build/frame-home/payload
- name: Build (MSVC)
shell: cmd
run: studio\build_windows.bat ${{ matrix.arch }} "%GITHUB_WORKSPACE%\build\windows-${{ matrix.arch }}"
Expand All @@ -68,15 +111,15 @@ jobs:
Copy-Item "build/windows-${{ matrix.arch }}/Frame Studio.exe" $stage
Copy-Item -Recurse "build/windows-${{ matrix.arch }}/frame" "$stage/frame"
Copy-Item LICENSE "$stage/LICENSE.txt"
New-Item -ItemType Directory -Force dist | Out-Null
Compress-Archive -Path $stage -DestinationPath "dist/$name.zip" -Force
- uses: actions/upload-artifact@v4
- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: FrameStudio-windows-${{ matrix.arch }}
path: dist/FrameStudio-windows-${{ matrix.arch }}.zip
path: build/stage/FrameStudio-windows-${{ matrix.arch }}

macos:
name: macOS ${{ matrix.arch }}
needs: [frame-home]
strategy:
fail-fast: false
matrix:
Expand All @@ -87,32 +130,90 @@ jobs:
- { arch: x64, runner: macos-15-intel }
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
env:
FRAME_USE_CCACHE: "1"
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
CCACHE_COMPILERCHECK: content
steps:
- uses: actions/checkout@v4
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/.ccache
key: ccache-studio-macos-${{ matrix.arch }}-${{ github.sha }}
restore-keys: ccache-studio-macos-${{ matrix.arch }}-
- name: Restore Homebrew package cache
uses: actions/cache@v5
with:
path: ~/Library/Caches/Homebrew/downloads
key: brew-macos-${{ matrix.arch }}-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: brew-macos-${{ matrix.arch }}-
- name: Download Frame Home payload
uses: actions/download-artifact@v4
with:
name: FrameHome-payload
path: build/frame-home/payload
- name: Tools and MoltenVK (Vulkan on Metal, bundled into the app)
run: brew install ninja molten-vk
run: brew install ccache ninja molten-vk
- name: Build
run: sh scripts/build-studio.sh macos-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
- name: Show compiler cache statistics
run: ccache --show-stats
- name: Upload macOS build
uses: actions/upload-artifact@v4
with:
name: FrameStudio-macos-${{ matrix.arch }}
path: dist/FrameStudio-macos-${{ matrix.arch }}.zip
path: build/stage/FrameStudio-macos-${{ matrix.arch }}

frame-home:
name: Frame Home installer
runs-on: ubuntu-24.04
timeout-minutes: 30
name: Build Frame Home payload
runs-on: ubuntu-24.04-arm
timeout-minutes: 45
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
CCACHE_COMPILERCHECK: content
APT_CACHE_DIR: ${{ github.workspace }}/.apt-cache
steps:
- uses: actions/checkout@v4
- name: Headset programs match the source
run: sh scripts/frame-payload.sh check
- name: Package
run: sh scripts/build-studio.sh frame-home
- uses: actions/upload-artifact@v4
- name: Check out source
uses: actions/checkout@v4
- name: Restore compiler cache
uses: actions/cache@v5
with:
path: ${{ github.workspace }}/.ccache
key: ccache-frame-home-arm64-${{ github.sha }}
restore-keys: ccache-frame-home-arm64-
- name: Restore apt package cache
uses: actions/cache@v5
with:
path: .apt-cache/archives
key: apt-ubuntu-24.04-arm64-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: apt-ubuntu-24.04-arm64-
- name: Install Frame Home build dependencies
run: |
set -euo pipefail
sudo mkdir -p "$APT_CACHE_DIR/archives/partial"
sudo chown _apt:root "$APT_CACHE_DIR/archives/partial"
sudo apt-get update
sudo apt-get -o Dir::Cache::archives="$APT_CACHE_DIR/archives" install -y ccache cmake ninja-build gcc-13 g++-13 glslc zip
sudo chown -R "$(id -u):$(id -g)" "$APT_CACHE_DIR/archives"
- name: Build payload and installer
run: sh scripts/build-frame-home.sh --ci
- name: Show compiler cache statistics
run: ccache --show-stats
- name: Upload Frame Home payload
uses: actions/upload-artifact@v4
with:
name: FrameHome-payload
path: build/frame-home/payload
- name: Upload Frame Home installer
uses: actions/upload-artifact@v4
with:
name: FrameHome-installer
path: dist/FrameHome-installer.zip

path: build/frame-home/FrameHome-installer-stage/FrameHome-installer
if-no-files-found: error
release:
name: Publish
# "latest" gets every build that finished (a failed or still-slow platform just isn't in it); a version release
Expand All @@ -125,30 +226,83 @@ jobs:
timeout-minutes: 20
permissions:
contents: write
id-token: write
attestations: write
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
steps:
- uses: actions/download-artifact@v4
- name: Download Studio build artifacts
uses: actions/download-artifact@v4
with:
pattern: FrameStudio-*
path: dist
merge-multiple: true
- uses: actions/checkout@v4
with:
path: src
# Every download carries frame/payload: none is published beside headset programs older than the source
# (Studio would save environments the headset can't open).
- name: Headset programs match the source
run: sh src/scripts/frame-payload.sh check
merge-multiple: false
- name: Download Frame Home payload
uses: actions/download-artifact@v4
with:
name: FrameHome-payload
path: ${{ runner.temp }}/frame-home-payload
- name: Download Frame Home installer
uses: actions/download-artifact@v4
with:
name: FrameHome-installer
path: dist/FrameHome-installer
- name: Rebuild release archives
run: |
for package in dist/FrameStudio-linux-*; do
[ -d "$package" ] || continue
name=${package##*/}
if [ -d "$package/frame/bin" ]; then
chmod +x "$package/frame/install.sh" "$package/frame/bin/"*
fi
tar -czf "dist/$name.tar.gz" -C dist "$name"
rm -rf "$package"
done
for package in dist/FrameStudio-windows-* dist/FrameStudio-macos-*; do
[ -d "$package" ] || continue
name=${package##*/}
if [ -d "$package/frame/bin" ]; then
chmod +x "$package/frame/install.sh" "$package/frame/bin/"*
fi
if [[ "$name" == FrameStudio-macos-* ]]; then
chmod +x "$package/Frame Studio.app/Contents/MacOS/Frame Studio"
fi
(cd dist && zip -qr "$name.zip" "$name")
rm -rf "$package"
done
chmod +x dist/FrameHome-installer/install-frame-home.sh \\
dist/FrameHome-installer/payload/install.sh \\
dist/FrameHome-installer/payload/bin/*
(cd dist && zip -qr FrameHome-installer.zip FrameHome-installer)
rm -rf dist/FrameHome-installer
python3 - <<'PY'
from pathlib import Path
from zipfile import ZipFile

for path in Path("dist").glob("*.zip"):
with ZipFile(path) as archive:
nested = [name for name in archive.namelist() if name.lower().endswith(".zip")]
if nested:
raise SystemExit(f"{path} contains nested ZIP files: {nested}")
PY
# What Frame Studio (studio/updater.h) and the headset's Environments panel check for updates: this commit,
# Frame Home's identity (a hash of the headset programs, the same one the panel works out for what's installed)
# and the files in this release.
- name: latest.json
run: |
home=$(cd src/frame/payload && sha256sum bin/frame-home bin/frame-switcher bin/fenv-tool layer/libframe_home_layer.so layer/env_ps.spv | cut -c1-64 | sha256sum | cut -c1-64)
home=$(cd "$RUNNER_TEMP/frame-home-payload" && sha256sum bin/frame-home bin/frame-switcher bin/fenv-tool layer/libframe_home_layer.so layer/env_ps.spv | cut -c1-64 | sha256sum | cut -c1-64)
files=$(ls dist | python3 -c 'import json, sys; print(json.dumps([l.strip() for l in sys.stdin if l.strip()]))')
printf '{"build": "%s", "home": "%s", "date": "%s", "files": %s}\n' "$GITHUB_SHA" "$home" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$files" > dist/latest.json
cat dist/latest.json
- name: Attest Studio release archives
uses: actions/attest-build-provenance@v2
with:
subject-path: dist/FrameStudio-*
- name: Attest Frame Home installer
uses: actions/attest-build-provenance@v2
with:
subject-path: dist/FrameHome-installer.zip
- name: Version release (tag v*)
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(needs.*.result, 'failure') }}
run: gh release create "${{ github.ref_name }}" dist/* --repo "$REPO" --title "Frame Studio ${{ github.ref_name }}" --generate-notes
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# build output
/build*/
/dist/
/frame/payload/bin/
/frame/payload/layer/libframe_home_layer.so
/frame/payload/layer/env_ps.spv
/frame/payload/SOURCE
studio/build*/
tools/*/build*/
# editor / OS clutter
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ headset runs, and lets you edit, save and send them to the headset.

## Downloads

Every push builds everything. The newest build of `main` is always on the Releases page as **Latest build**; tagged
versions (`v1.0`, ...) get their own release. Builds of other branches are under Actions (open a run, then
Artifacts). Once installed, Frame Studio and Frame Home both update themselves from **Latest build**: Studio from its
top bar, Frame Home from the Environments panel on the headset.
Every push builds Frame Studio and its matching Frame Home payload. The **Latest build** release contains both Studio
packages and `FrameHome-installer.zip`; each `v*` version release contains both products too. Studio updates from its
top bar, and Frame Home updates from the Environments panel on the headset. Both use the same release channel.

| Computer | Frame Studio |
|---|---|
Expand All @@ -39,6 +38,8 @@ Studio needs a GPU with Vulkan 1.2: any recent NVIDIA, AMD or Intel driver on Wi
runs on Metal through MoltenVK, which comes inside the app. The 32-bit builds have at most 4 GB to work in, so the
very largest homes may not fit.

See [Installing Frame Home](docs/install-frame-home.md) for how to install the runtime on a Steam Frame.

## Highlights

**Frame Home (on the headset)**
Expand Down Expand Up @@ -75,7 +76,7 @@ very largest homes may not fit.
| [Performance](docs/performance.md) | Reaching 120 fps, checking it, fixing stutter |
| [Frame Studio guide](docs/studio-guide.md) | The Studio window, tools and panels |
| [Bundles](docs/bundles.md) | Several environments in one `.fbundle` |
| [Building from source](docs/building.md) | Building on each system, CI, the headset side |
| [Building from source](docs/building.md) | Building on each system, CI, and Frame Home payload builds |
| [Troubleshooting](docs/troubleshooting.md) | Symptoms and fixes, logs, the self-test |

## Building from source
Expand All @@ -87,8 +88,8 @@ Everything Studio needs is in `third_party/`; you need CMake 3.16+ and Ninja. In
| Windows (Visual Studio 2022 with C++) | `studio\build_windows.bat x64` (or `x86`, `arm64`) |
| Linux, macOS | `scripts/build-studio.sh <target>...` or `scripts/build-studio.sh all` |

The headset side is built on the Steam Frame; a ready-built copy is in `frame/payload/`. Full details, prerequisites
and the CI: [docs/building.md](docs/building.md).
Frame Home binaries are built in GitHub Actions and are not checked into `frame/payload/`. Full details, prerequisites
and CI: [docs/building.md](docs/building.md).

## Repository layout

Expand All @@ -97,7 +98,7 @@ and the CI: [docs/building.md](docs/building.md).
| `studio/` | Frame Studio: `studio.cpp` (the editor), `platform*.{h,cpp}` (Windows, Linux, macOS), `frame_pacer.h` |
| `src/` | Shared engine: renderer (`hsl_renderer`), scene loading and baking, `.fenv`, walkable area, Frame Home (`main.cpp`), the Environments panel (`switcher.cpp`), `fenv-tool` |
| `layer/` | The Vulkan layer inside SteamVR's compositor that shows Frame Home in place of its environment |
| `frame/` | The headset payload and the stand-alone installers |
| `frame/` | Frame Home installer source and stand-alone installer scripts |
| `scripts/`, `cmake/` | Build script and the llvm-mingw toolchain file |
| `tools/`, `tests_loco/` | Test and measuring tools, movement tests |
| `third_party/` | Vendored libraries (each with its own license) |
Expand Down
Loading