Skip to content

Commit e714328

Browse files
committed
initial release
0 parents  commit e714328

275 files changed

Lines changed: 82374 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/blit/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../SKILL.md

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-unknown-linux-musl]
2+
rustflags = ["-C", "target-feature=+crt-static"]
3+
4+
[target.aarch64-unknown-linux-musl]
5+
rustflags = ["-C", "target-feature=+crt-static"]

.devcontainer/devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "blit",
3+
"image": "mcr.microsoft.com/devcontainers/rust:1-bookworm",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": { "version": "22" }
6+
},
7+
"postCreateCommand": "rustup target add x86_64-pc-windows-msvc && cargo fetch",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": ["rust-lang.rust-analyzer", "vadimcn.vscode-lldb"],
11+
"settings": {
12+
"rust-analyzer.check.targets": [
13+
"x86_64-unknown-linux-gnu",
14+
"x86_64-pc-windows-msvc"
15+
]
16+
}
17+
}
18+
}
19+
}

.envrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# shellcheck shell=bash
2+
set -euo pipefail
3+
4+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
5+
source_url https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=
6+
fi
7+
use flake .
8+
9+
# nix-direnv does not propagate LD_LIBRARY_PATH from the devShell
10+
# (direnv filters it). blit-server dlopen's GPU driver libraries
11+
# (libcuda, libnvidia-encode, libva, libva-drm) at runtime; they
12+
# live under /run/opengl-driver/lib on NixOS.
13+
if [ -d /run/opengl-driver/lib ]; then
14+
export LD_LIBRARY_PATH="/run/opengl-driver/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
15+
fi

.github/blit.gpg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
3+
mDMEaburGhYJKwYBBAHaRw8BAQdA1tudwnANRw/HmTua/7RwzlPNBpoeWd9PcU+i
4+
bVcNSZO0FmJsaXQgPGJsaXRAaW5kZW50LmNvbT6IjgQTFgoANhYhBCMcPlnFJSaj
5+
M0jPwctESyr7erHfBQJpu6saAhsjBAsJCAcEFQoJCAUWAgMBAAIeAQIXgAAKCRDL
6+
REsq+3qx3/BcAP4kkU444Im46AxZaD43tA+UmhIGccdnxElNrNckVZBzBAEAwojA
7+
L/rNIYxPDoPIYTS24/6M6bFCP+BsgbP4X0ImMAM=
8+
=PFQu
9+
-----END PGP PUBLIC KEY BLOCK-----

.github/workflows/coverage.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
coverage:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: DeterminateSystems/nix-installer-action@main
16+
- uses: DeterminateSystems/magic-nix-cache-action@main
17+
18+
- name: Run tests with coverage
19+
run: ./bin/coverage
20+
21+
- name: Upload HTML report
22+
uses: actions/upload-artifact@v4
23+
if: always()
24+
with:
25+
name: coverage-report
26+
path: coverage-report/html/
27+
retention-days: 30
28+
29+
- name: Post coverage summary on PR
30+
if: github.event_name == 'pull_request'
31+
uses: marocchino/sticky-pull-request-comment@v2
32+
with:
33+
header: coverage
34+
path: coverage-summary.txt

.github/workflows/deploy-hub.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Deploy hub
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "js/hub/**"
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: DeterminateSystems/nix-installer-action@main
15+
- run: nix run .#deploy-hub
16+
env:
17+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy website
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "js/website/**"
8+
- "js/core/**"
9+
- "js/react/**"
10+
- "crates/browser/**"
11+
pull_request:
12+
paths:
13+
- "js/website/**"
14+
- "js/core/**"
15+
- "js/react/**"
16+
- "crates/browser/**"
17+
18+
jobs:
19+
deploy:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
pull-requests: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: DeterminateSystems/nix-installer-action@main
26+
- uses: DeterminateSystems/magic-nix-cache-action@main
27+
- name: Deploy to Vercel
28+
id: deploy
29+
run: |
30+
args=()
31+
if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/main" ]; then
32+
args+=(--prod)
33+
fi
34+
output=$(./bin/deploy-website "${args[@]}" 2>&1 | tee /dev/stderr) || exit $?
35+
url=$(echo "$output" | grep -o 'https://[^ ]*\.vercel\.app' | tail -1)
36+
echo "url=$url" >> "$GITHUB_OUTPUT"
37+
env:
38+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
39+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
40+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
41+
- name: Comment preview URL on PR
42+
if: github.event_name == 'pull_request' && steps.deploy.outputs.url
43+
uses: actions/github-script@v7
44+
with:
45+
script: |
46+
const body = `🔗 **Preview:** ${{ steps.deploy.outputs.url }}`;
47+
const { data: comments } = await github.rest.issues.listComments({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: context.issue.number,
51+
});
52+
const existing = comments.find(c => c.body.startsWith('🔗 **Preview:**'));
53+
if (existing) {
54+
await github.rest.issues.updateComment({
55+
owner: context.repo.owner,
56+
repo: context.repo.repo,
57+
comment_id: existing.id,
58+
body,
59+
});
60+
} else {
61+
await github.rest.issues.createComment({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
issue_number: context.issue.number,
65+
body,
66+
});
67+
}

.github/workflows/dev-check.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: dev-check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
dev-check:
10+
name: dev-check
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
- uses: DeterminateSystems/magic-nix-cache-action@main
18+
19+
- name: Run dev-check
20+
run: nix develop --command ./bin/dev-check
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish demo image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
8+
jobs:
9+
build-push:
10+
strategy:
11+
matrix:
12+
include:
13+
- runner: ubuntu-latest
14+
arch: amd64
15+
- runner: ubuntu-24.04-arm
16+
arch: arm64
17+
runs-on: ${{ matrix.runner }}
18+
env:
19+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
20+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: DeterminateSystems/nix-installer-action@main
24+
- uses: DeterminateSystems/magic-nix-cache-action@main
25+
26+
- name: Push arch-specific image
27+
run: |
28+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
29+
nix run .#push-demo -- "${{ matrix.arch }}" "${GITHUB_REF#refs/tags/v}"
30+
else
31+
nix run .#push-demo -- "${{ matrix.arch }}"
32+
fi
33+
34+
manifest:
35+
needs: build-push
36+
runs-on: ubuntu-latest
37+
env:
38+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
39+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: DeterminateSystems/nix-installer-action@main
43+
- uses: DeterminateSystems/magic-nix-cache-action@main
44+
45+
- name: Create and push multi-arch manifest
46+
run: |
47+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
48+
nix run .#publish-demo -- "${GITHUB_REF#refs/tags/v}"
49+
else
50+
nix run .#publish-demo
51+
fi

0 commit comments

Comments
 (0)