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
124 changes: 124 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# The website: Bureau draws the pictures of its own kit on a Mac (Metal), then
# the pages are built around them and published to GitHub Pages. The
# repository's Pages settings must use "GitHub Actions" as the source.
#
# A pull request that touches the site, the kit or the docs builds it all and
# publishes nothing, so a change that would break a picture shows before it is
# merged. Only main is published, whatever starts the run.
name: Website

on:
push:
branches: [main]
pull_request:
paths:
- "site/**"
- "kit/**"
- "docs/**"
- "src/**"
- "include/**"
- "assets/**"
- "tools/**"
- "CMakeLists.txt"
- "deno.json"
- "deno.lock"
- "package.json"
- ".github/workflows/site.yml"
workflow_dispatch:

permissions:
contents: read

# One deployment at a time; a newer push waits instead of cancelling one in progress.
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: false

jobs:
pictures:
name: Draw the pictures
runs-on: macos-26
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: denoland/setup-deno@v2
with:
deno-version: v2.9.6

- name: Dependencies
run: |
brew install ninja
deno install --frozen

- name: Keep the pinned Hermes between runs
uses: actions/cache@v4
with:
path: third_party/hermes
key: hermes-${{ runner.os }}-${{ hashFiles('third_party/hermes.pin.json') }}

- name: Hermes
run: deno task hermes

- name: Pictures
run: deno task site:pictures

- uses: actions/upload-artifact@v4
with:
name: pictures
path: build/site/pictures
if-no-files-found: error

build:
name: Build the website
needs: pictures
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: denoland/setup-deno@v2
with:
deno-version: v2.9.6

- run: deno install --frozen

- uses: actions/download-artifact@v4
with:
name: pictures
path: pictures

- id: pages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/configure-pages@v5

- name: Pages
run: deno task site
env:
SITE_PICTURES: pictures
# The path the site is served under, such as /bureau, for 404.html.
BASE_PATH: ${{ steps.pages.outputs.base_path }}

- if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: site/dist

deploy:
name: Publish to GitHub Pages
needs: build
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/compile_commands.json
node_modules
.DS_Store
/site/dist/
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,16 @@ if(BUREAU_BUILD_TESTS)
"${bureau_hermes_framework_dir}")
add_test(NAME bureau_ui_tests COMMAND bureau_ui_tests)
endif()

# The website's pictures: Bureau draws its own kit through the Metal backend
# (site/specimens/render.mm, run by `deno task site:pictures`).
if(TARGET bureau_js AND TARGET bureau_metal)
add_executable(bureau_specimens site/specimens/render.mm)
target_compile_options(bureau_specimens PRIVATE -fobjc-arc)
target_link_libraries(bureau_specimens PRIVATE bureau_js bureau_metal
"-framework Foundation" "-framework CoreGraphics" "-framework ImageIO"
"-framework UniformTypeIdentifiers")
set_target_properties(bureau_specimens PROPERTIES BUILD_RPATH
"${bureau_hermes_framework_dir}")
endif()
endif()
4 changes: 3 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"bundle": "deno run -A tools/bundle.ts",
"bundle:tests": "deno task bundle tests/bundles/literal_entry.tsx bundles/literal && deno task bundle tests/bundles/closure_entry.tsx bundles/closure && deno task bundle tests/bundles/unicode_entry.tsx bundles/unicode && deno task bundle tests/bundles/hello_entry.tsx bundles/hello",
"tokens": "deno run --allow-read --allow-write tools/tokens.ts",
"check": "deno check kit tools tests/bundles",
"check": "deno check kit tools tests/bundles site",
"site:pictures": "deno run -A site/pictures.ts",
"site": "deno run --allow-read --allow-write --allow-env site/build.ts",
"test": "deno test --allow-all --no-check --sanitize-ops --sanitize-resources kit tools"
},
"lint": {
Expand Down
6 changes: 6 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions docs/integrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,13 @@ deno task test

The first configure fetches the pinned commits in
`third_party/dependencies.cmake`.

The website in `site/` shows every component as a picture Bureau draws of
itself. Each picture is a specimen in `site/specimens/`: a function that
renders the component, and the words the library sets beside it.

```sh
deno task site:pictures # every picture, through the Metal backend (a Mac)
deno task site:pictures button # one, by its id
deno task site # the pages, into site/dist/
```
2 changes: 1 addition & 1 deletion kit/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3831,7 +3831,7 @@ export const ANIMATIONS = {
tempo: "fill",
easing: "linear",
fill: "forwards",
frames: [{ at: [100], scaleX: 1 }],
frames: [{ at: [0], scaleX: 0 }, { at: [100], scaleX: 1 }],
},
"bureau-keycap-blink": {
cycleMs: 480,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@types/react-reconciler": "^0.34.0",
"@vitejs/plugin-react": "^6.1.1",
"babel-plugin-react-compiler": "^1.0.0",
"marked": "17.0.1",
"vite": "^8.3.3"
}
}
Binary file added site/art/world.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading