Skip to content

Commit 05998ad

Browse files
Merge branch 'master' into qr-code-node
2 parents 869a5f8 + da51885 commit 05998ad

File tree

314 files changed

+7489
-5555
lines changed

Some content is hidden

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

314 files changed

+7489
-5555
lines changed

.branding

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
https://github.com/Keavon/graphite-branded-assets/archive/f8b02e68c92f5bbd27626bdd7a51102303b70a40.tar.gz
2-
d06fd7b79fa9b7509c23072fa56745415fdc6eb98575d15214b0acc47ea4dd42
1+
https://github.com/Keavon/graphite-branded-assets/archive/f44aa2f362ae4fed8d634878b817a1d3948a7dcb.tar.gz
2+
dffe2b483e491979ef57c320d61446ada5400ef73ff26582976631d9c36efefc

.github/pull_request_template.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
<!-- Please reference any relevant issue number below, optionally with a "Closes"/"Resolves"/"Fixes" prefix -->
1+
<!--
2+
Graphite has ZERO-TOLERANCE for contributing undisclosed AI-generated content.
3+
If your PR involves AI, you must read our AI contribution policy (it's short):
4+
https://graphite.art/volunteer/guide/starting-a-task/ai-contribution-policy
25
3-
Closes #
6+
REMEMBER:
7+
- You are responsible for thoroughly testing the successful implementation of your changes and ensuring no obvious regressions occur.
8+
- Egregiously dysfunctional PRs may be assumed to be undisclosed AI slop. If in doubt, ask on Discord before attempting a PR.
9+
- You are highly recommended to include a video showing the before-and-after behavior of your changes and screenshots of any new or modified UI.
10+
- Remember that Graphite maintains high standards for quality and the project is not a classroom for inexperienced developers to gain industry experience.
11+
- In this PR description, reference any relevant tasks by writing "Closes", "Resolves", or "Fixes" with the issue # or the URL of a Discord message documenting the task.
12+
- To acknowledge that you've read this, you must delete these rules and fill in the (strictly human-written) PR description in its place.
13+
-->

.github/workflows/build-dev-and-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ jobs:
113113
- name: 📃 Generate code documentation info for website
114114
if: github.ref == 'refs/heads/master'
115115
run: |
116-
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
116+
cd tools/editor-message-tree
117+
cargo run
118+
cd ../..
117119
mkdir -p artifacts-generated
118-
mv hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
120+
mv website/generated/hierarchical_message_system_tree.txt artifacts-generated/hierarchical_message_system_tree.txt
119121
120122
- name: 💿 Obtain cache of auto-generated code docs artifacts, to check if they've changed
121123
if: github.ref == 'refs/heads/master'
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build Linux Bundle
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
- uses: DeterminateSystems/magic-nix-cache-action@main
18+
19+
- name: Free disk space
20+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
21+
22+
- name: Build Linux Bundle
23+
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
24+
25+
- name: Upload Linux Bundle
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: graphite-linux-bundle
29+
path: graphite-linux-bundle.tar.xz
30+
compression-level: 0
31+
32+
- name: Setup Flatpak Tooling
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y flatpak flatpak-builder
36+
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
37+
38+
- name: Build Flatpak
39+
run: |
40+
nix build .nix#graphite-flatpak-manifest
41+
42+
rm -rf .flatpak
43+
mkdir -p .flatpak
44+
45+
cp ./result .flatpak/manifest.json
46+
47+
cd .flatpak
48+
mkdir -p repo
49+
50+
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo build ./manifest.json
51+
52+
flatpak build-bundle repo graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
53+
54+
- name: Upload Flatpak
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: graphite-flatpak
58+
path: .flatpak/graphite.flatpak
59+
compression-level: 0
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Provide Shaders
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
- uses: DeterminateSystems/magic-nix-cache-action@main
18+
19+
- name: Build graphene raster nodes shaders
20+
run: nix build .nix#raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl
21+
22+
- name: Upload graphene raster nodes shaders to artifacts repository
23+
run: |
24+
bash .github/workflows/scripts/artifact-upload.bash \
25+
${{ vars.ARTIFACTS_REPO_OWNER }} \
26+
${{ vars.ARTIFACTS_REPO_NAME }} \
27+
${{ vars.ARTIFACTS_REPO_BRANCH }} \
28+
rev/${{ github.sha }}/raster_nodes_shaders_entrypoint.wgsl \
29+
raster_nodes_shaders_entrypoint.wgsl \
30+
"${{ github.sha }} raster_nodes_shaders_entrypoint.wgsl" \
31+
${{ secrets.ARTIFACTS_REPO_TOKEN }}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
usage() {
5+
cat <<EOF
6+
Usage: $0 <owner> <repo> <branch> <target-path> <artifact-file> <commit-message> <github-token>
7+
8+
Arguments:
9+
owner : GitHub user or organization of the target repo
10+
repo : Target repo name
11+
branch : Branch name (e.g. main)
12+
target-path : Full path (including folders + filename) in the target repo where to upload
13+
artifact-file : Local file path to upload
14+
commit-message : Commit message for creating/updating the file
15+
github-token : GitHub token (PAT or equivalent) with write access to the target repo
16+
17+
This will perform a GitHub API PUT to /repos/{owner}/{repo}/contents/{target-path}.
18+
If a file already exists at that path, it will auto-detect the SHA and update; otherwise it will create a new one.
19+
EOF
20+
exit 1
21+
}
22+
23+
if [ $# -ne 7 ]; then
24+
usage
25+
fi
26+
27+
OWNER="$1"
28+
REPO="$2"
29+
BRANCH="$3"
30+
TARGET_PATH="$4"
31+
ARTIFACT_PATH="$5"
32+
COMMIT_MSG="$6"
33+
TOKEN="$7"
34+
35+
if [ ! -f "$ARTIFACT_PATH" ]; then
36+
echo "Error: artifact file not found: $ARTIFACT_PATH" >&2
37+
exit 1
38+
fi
39+
40+
LOCAL_SHA=$(git hash-object "$ARTIFACT_PATH")
41+
echo "Local blob SHA: $LOCAL_SHA"
42+
43+
GET_URL="https://api.github.com/repos/${OWNER}/${REPO}/contents/${TARGET_PATH}?ref=${BRANCH}"
44+
GET_RESPONSE=$(curl -s -H "Authorization: token ${TOKEN}" "$GET_URL")
45+
46+
REMOTE_SHA=$(echo "$GET_RESPONSE" | jq -r .sha 2>/dev/null || echo "")
47+
48+
if [ "$REMOTE_SHA" != "null" ] && [ -n "$REMOTE_SHA" ]; then
49+
echo "Remote blob SHA: $REMOTE_SHA"
50+
if [ "$LOCAL_SHA" = "$REMOTE_SHA" ]; then
51+
echo "The remote file is identical. Skipping upload."
52+
exit 0
53+
else
54+
echo "Remote file differs. Preparing to upload."
55+
fi
56+
else
57+
echo "No existing remote file or no SHA found. Creating."
58+
fi
59+
60+
CONTENT_TMP_BASE64=$(mktemp)
61+
if base64 --help 2>&1 | grep -q -- "-w"; then
62+
base64 -w 0 "$ARTIFACT_PATH" > "$CONTENT_TMP_BASE64"
63+
else
64+
base64 "$ARTIFACT_PATH" | tr -d '\n' > "$CONTENT_TMP_BASE64"
65+
fi
66+
67+
PAYLOAD_TMP=$(mktemp)
68+
jq -n \
69+
--arg message "$COMMIT_MSG" \
70+
--arg branch "$BRANCH" \
71+
--arg sha "$REMOTE_SHA" \
72+
--rawfile content "$CONTENT_TMP_BASE64" \
73+
'{
74+
message: $message,
75+
content: $content,
76+
branch: $branch
77+
} + (if ($sha != "" and $sha != "null") then { sha: $sha } else {} end)' \
78+
> "$PAYLOAD_TMP"
79+
80+
UPLOAD_RESPONSE=$(curl -s -X PUT \
81+
-H "Authorization: token ${TOKEN}" \
82+
-H "Content-Type: application/json" \
83+
-d @"$PAYLOAD_TMP" \
84+
"https://api.github.com/repos/${OWNER}/${REPO}/contents/${TARGET_PATH}")
85+
86+
echo "Upload Response:"
87+
echo "$UPLOAD_RESPONSE"
88+
89+
rm -f "$CONTENT_TMP_BASE64" "$PAYLOAD_TMP"

.github/workflows/website.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: 🕸 Install Zola
3838
uses: taiki-e/install-action@v2
3939
with:
40-
tool: zola@0.20.0
40+
tool: zola@0.22.0
4141

4242
- name: 🔍 Check if `website/other` directory changed
4343
uses: dorny/paths-filter@v3
@@ -67,19 +67,27 @@ jobs:
6767
rustup update stable
6868
echo "🦀 Latest updated version of Rust:"
6969
rustc --version
70-
cargo test --package graphite-editor --lib -- messages::message::test::generate_message_tree
70+
cd tools/editor-message-tree
71+
cargo run
72+
cd ../..
7173
mkdir artifacts
72-
mv hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
74+
mv website/generated/hierarchical_message_system_tree.txt artifacts/hierarchical_message_system_tree.txt
7375
74-
- name: 🚚 Move `artifacts` contents to the project root
76+
- name: 🚚 Move `artifacts` contents to website/generated
7577
run: |
76-
mv artifacts/* .
78+
mkdir -p website/generated
79+
mv artifacts/* website/generated/
7780
7881
- name: 🔧 Build auto-generated code docs artifacts into HTML
7982
run: |
8083
cd website
8184
npm run generate-editor-structure
8285
86+
- name: 📃 Generate node catalog documentation
87+
run: |
88+
cd tools/node-docs
89+
cargo run
90+
8391
- name: 🌐 Build Graphite website with Zola
8492
env:
8593
MODE: prod

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
branding/
22
target/
33
result/
4+
.flatpak-builder/
45
*.spv
56
*.exrc
67
perf.data*
@@ -10,5 +11,3 @@ flamegraph.svg
1011
.idea/
1112
.direnv
1213
.DS_Store
13-
hierarchical_message_system_tree.txt
14-
hierarchical_message_system_tree.html

.nix/deps/cef.nix

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
{ pkgs, inputs, ... }:
22

33
let
4-
cef = pkgs.cef-binary.overrideAttrs (_: _: {
4+
cef = pkgs.cef-binary.overrideAttrs {
55
postInstall = ''
66
strip $out/Release/*.so*
77
'';
8-
});
8+
};
99

10-
cefPath = pkgs.runCommand "cef-path" {} ''
10+
cefPath = pkgs.runCommand "cef-path" { } ''
1111
mkdir -p $out
1212
1313
ln -s ${cef}/include $out/include
1414
find ${cef}/Release -name "*" -type f -exec ln -s {} $out/ \;
1515
find ${cef}/Resources -name "*" -maxdepth 1 -exec ln -s {} $out/ \;
1616
17-
echo '${builtins.toJSON {
18-
type = "minimal";
19-
name = builtins.baseNameOf cef.src.url;
20-
sha1 = "";
21-
}}' > $out/archive.json
17+
echo '${
18+
builtins.toJSON {
19+
type = "minimal";
20+
name = builtins.baseNameOf cef.src.url;
21+
sha1 = "";
22+
}
23+
}' > $out/archive.json
2224
'';
2325
in
2426
{

.nix/flake.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
info = {
3434
pname = "graphite";
3535
version = "unstable";
36-
src = ./..;
36+
src = pkgs.lib.cleanSourceWith {
37+
src = ./..;
38+
filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
39+
};
3740
};
3841

3942
pkgs = import inputs.nixpkgs {
@@ -129,6 +132,13 @@
129132
embeddedResources = false;
130133
dev = true;
131134
};
135+
graphite-bundle = import ./pkgs/graphite-bundle.nix {
136+
inherit pkgs graphite;
137+
};
138+
graphite-flatpak-manifest = import ./pkgs/graphite-flatpak-manifest.nix {
139+
inherit pkgs;
140+
archive = graphite-bundle.tar;
141+
};
132142
#TODO: graphene-cli = import ./pkgs/graphene-cli.nix { inherit info pkgs inputs deps libs tools; };
133143
raster-nodes-shaders = import ./pkgs/raster-nodes-shaders.nix {
134144
inherit

0 commit comments

Comments
 (0)