From 4ac26584f28f340a9fe8f9ba94c72a104e002994 Mon Sep 17 00:00:00 2001 From: Timon Schelling Date: Fri, 2 Jan 2026 16:21:10 +0000 Subject: [PATCH 1/4] raster_nodes_shaders_entrypoint.wgsl upload --- .github/workflows/provide-shaders.yml | 29 ++++++ .../workflows/scripts/artifact-upload.bash | 89 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 .github/workflows/provide-shaders.yml create mode 100644 .github/workflows/scripts/artifact-upload.bash diff --git a/.github/workflows/provide-shaders.yml b/.github/workflows/provide-shaders.yml new file mode 100644 index 0000000000..afc02aaf32 --- /dev/null +++ b/.github/workflows/provide-shaders.yml @@ -0,0 +1,29 @@ +name: Build and upload shaders for graphene raster nodes to artifacts Repository + +on: + push: + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + + - name: Build graphene raster nodes shaders + run: nix build .nix#raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl + + - name: Upload graphene raster nodes shaders to artifacts repository + run: | + bash .github/workflows/scripts/artifact-upload.bash \ + ${{ vars.ARTIFACTS_REPO_OWNER }} \ + ${{ vars.ARTIFACTS_REPO_NAME }} \ + ${{ vars.ARTIFACTS_REPO_BRANCH }} \ + rev/${{ github.sha }}/raster_nodes_shaders_entrypoint.wgsl \ + raster_nodes_shaders_entrypoint.wgsl \ + "${{ github.sha }} raster_nodes_shaders_entrypoint.wgsl" \ + ${{ secrets.ARTIFACTS_REPO_TOKEN }} diff --git a/.github/workflows/scripts/artifact-upload.bash b/.github/workflows/scripts/artifact-upload.bash new file mode 100644 index 0000000000..5e8f50dec0 --- /dev/null +++ b/.github/workflows/scripts/artifact-upload.bash @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat < + +Arguments: + owner : GitHub user or organization of the target repo + repo : Target repo name + branch : Branch name (e.g. main) + target-path : Full path (including folders + filename) in the target repo where to upload + artifact-file : Local file path to upload + commit-message : Commit message for creating/updating the file + github-token : GitHub token (PAT or equivalent) with write access to the target repo + +This will perform a GitHub API PUT to /repos/{owner}/{repo}/contents/{target-path}. +If a file already exists at that path, it will auto-detect the SHA and update; otherwise it will create a new one. +EOF + exit 1 +} + +if [ $# -ne 7 ]; then + usage +fi + +OWNER="$1" +REPO="$2" +BRANCH="$3" +TARGET_PATH="$4" +ARTIFACT_PATH="$5" +COMMIT_MSG="$6" +TOKEN="$7" + +if [ ! -f "$ARTIFACT_PATH" ]; then + echo "Error: artifact file not found: $ARTIFACT_PATH" >&2 + exit 1 +fi + +LOCAL_SHA=$(git hash-object "$ARTIFACT_PATH") +echo "Local blob SHA: $LOCAL_SHA" + +GET_URL="https://api.github.com/repos/${OWNER}/${REPO}/contents/${TARGET_PATH}?ref=${BRANCH}" +GET_RESPONSE=$(curl -s -H "Authorization: token ${TOKEN}" "$GET_URL") + +REMOTE_SHA=$(echo "$GET_RESPONSE" | jq -r .sha 2>/dev/null || echo "") + +if [ "$REMOTE_SHA" != "null" ] && [ -n "$REMOTE_SHA" ]; then + echo "Remote blob SHA: $REMOTE_SHA" + if [ "$LOCAL_SHA" = "$REMOTE_SHA" ]; then + echo "The remote file is identical. Skipping upload." + exit 0 + else + echo "Remote file differs. Preparing to upload." + fi +else + echo "No existing remote file or no SHA found. Creating." +fi + +CONTENT_TMP_BASE64=$(mktemp) +if base64 --help 2>&1 | grep -q -- "-w"; then + base64 -w 0 "$ARTIFACT_PATH" > "$CONTENT_TMP_BASE64" +else + base64 "$ARTIFACT_PATH" | tr -d '\n' > "$CONTENT_TMP_BASE64" +fi + +PAYLOAD_TMP=$(mktemp) +jq -n \ + --arg message "$COMMIT_MSG" \ + --arg branch "$BRANCH" \ + --arg sha "$REMOTE_SHA" \ + --rawfile content "$CONTENT_TMP_BASE64" \ + '{ + message: $message, + content: $content, + branch: $branch + } + (if ($sha != "" and $sha != "null") then { sha: $sha } else {} end)' \ + > "$PAYLOAD_TMP" + +UPLOAD_RESPONSE=$(curl -s -X PUT \ + -H "Authorization: token ${TOKEN}" \ + -H "Content-Type: application/json" \ + -d @"$PAYLOAD_TMP" \ + "https://api.github.com/repos/${OWNER}/${REPO}/contents/${TARGET_PATH}") + +echo "Upload Response:" +echo "$UPLOAD_RESPONSE" + +rm -f "$CONTENT_TMP_BASE64" "$PAYLOAD_TMP" From d4691daa2d52383b2323439d58ff59e18a0ed869 Mon Sep 17 00:00:00 2001 From: Timon Schelling Date: Fri, 2 Jan 2026 14:41:21 +0000 Subject: [PATCH 2/4] fix muda dep --- Cargo.lock | 19 +++++++++++++++---- desktop/Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24637bbd89..15906567ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2403,7 +2403,7 @@ dependencies = [ "graphene-std", "graphite-editor", "image", - "keyboard-types", + "keyboard-types 0.8.1", "ron", "serde", "serde_json", @@ -3170,6 +3170,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "keyboard-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" +dependencies = [ + "bitflags 2.9.3", + "serde", + "unicode-segmentation", +] + [[package]] name = "keyboard-types" version = "0.8.1" @@ -3516,11 +3527,11 @@ dependencies = [ [[package]] name = "muda" version = "0.17.1" -source = "git+https://github.com/tauri-apps/muda.git?rev=3f460b8fbaed59cda6d95ceea6904f000f093f15#3f460b8fbaed59cda6d95ceea6904f000f093f15" +source = "git+https://github.com/tauri-apps/muda.git?rev=dca083660d04209109ae854b9a9436a809daf409#dca083660d04209109ae854b9a9436a809daf409" dependencies = [ "crossbeam-channel", "dpi", - "keyboard-types", + "keyboard-types 0.7.0", "objc2 0.6.3", "objc2-app-kit 0.3.2", "objc2-core-foundation", @@ -7816,7 +7827,7 @@ dependencies = [ "bitflags 2.9.3", "cursor-icon", "dpi", - "keyboard-types", + "keyboard-types 0.8.1", "raw-window-handle", "serde", "smol_str", diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 377cb2b230..bfa0a835db 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -66,4 +66,4 @@ windows = { version = "0.58.0", features = [ objc2 = { version = "0.6.1", default-features = false } objc2-foundation = { version = "0.3.2", default-features = false } objc2-app-kit = { version = "0.3.2", default-features = false } -muda = { git = "https://github.com/tauri-apps/muda.git", rev = "3f460b8fbaed59cda6d95ceea6904f000f093f15", default-features = false } +muda = { git = "https://github.com/tauri-apps/muda.git", rev = "dca083660d04209109ae854b9a9436a809daf409", default-features = false } From 4214f6baa427fa4ada0b8c6d75b99ae0fe803089 Mon Sep 17 00:00:00 2001 From: Timon Schelling Date: Fri, 2 Jan 2026 16:49:12 +0000 Subject: [PATCH 3/4] fix names --- .github/workflows/provide-shaders.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/provide-shaders.yml b/.github/workflows/provide-shaders.yml index afc02aaf32..87b353e15f 100644 --- a/.github/workflows/provide-shaders.yml +++ b/.github/workflows/provide-shaders.yml @@ -1,11 +1,11 @@ -name: Build and upload shaders for graphene raster nodes to artifacts Repository +name: Build and Upload Shaders on: push: pull_request: jobs: - check: + build: runs-on: ubuntu-latest permissions: contents: read From a7f5c2036d2c931ce2f9e187e37b0f572802189d Mon Sep 17 00:00:00 2001 From: Timon Schelling Date: Fri, 2 Jan 2026 16:51:36 +0000 Subject: [PATCH 4/4] fix triggers --- .github/workflows/provide-shaders.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/provide-shaders.yml b/.github/workflows/provide-shaders.yml index 87b353e15f..25ae724691 100644 --- a/.github/workflows/provide-shaders.yml +++ b/.github/workflows/provide-shaders.yml @@ -1,8 +1,10 @@ -name: Build and Upload Shaders +name: Provide Shaders on: push: - pull_request: + branches: + - master + workflow_dispatch: {} jobs: build: