Skip to content

Commit 7f28e0b

Browse files
authored
Merge branch 'master' into mini-feature
2 parents aff16ff + a3f88b0 commit 7f28e0b

522 files changed

Lines changed: 12925 additions & 15036 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.

.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/f44aa2f362ae4fed8d634878b817a1d3948a7dcb.tar.gz
2-
dffe2b483e491979ef57c320d61446ada5400ef73ff26582976631d9c36efefc
1+
https://github.com/Keavon/graphite-branded-assets/archive/8ae15dc9c51a3855475d8cab1d0f29d9d9bc622c.tar.gz
2+
c19abe4ac848f3c835e43dc065c59e20e60233ae023ea0a064c5fed442be2d3d

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
use flake .nix
1+
use flake

.github/workflows/build-linux-bundle.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
2626

2727
- name: Build Nix Package
28-
run: nix build .nix --no-link --print-out-paths
28+
run: nix build --no-link --print-out-paths
2929

3030
- name: Push to Nix Cache
3131
if: github.ref == 'refs/heads/master' || inputs.push_to_cache == true
3232
env:
3333
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
3434
run: |
3535
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
36-
nix build .nix --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
36+
nix build --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
3737
3838
- name: Build Linux Bundle
39-
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
39+
run: nix build .#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
4040

4141
- name: Upload Linux Bundle
4242
uses: actions/upload-artifact@v4
@@ -53,7 +53,7 @@ jobs:
5353
5454
- name: Build Flatpak
5555
run: |
56-
nix build .nix#graphite-flatpak-manifest
56+
nix build .#graphite-flatpak-manifest
5757
5858
rm -rf .flatpak
5959
mkdir -p .flatpak
@@ -65,11 +65,11 @@ jobs:
6565
6666
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo build ./manifest.json
6767
68-
flatpak build-bundle repo graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
68+
flatpak build-bundle repo Graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
6969
7070
- name: Upload Flatpak
7171
uses: actions/upload-artifact@v4
7272
with:
7373
name: graphite-flatpak
74-
path: .flatpak/graphite.flatpak
74+
path: .flatpak/Graphite.flatpak
7575
compression-level: 0

.github/workflows/build-mac-bundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Build Mac Bundle
6868
env:
6969
CARGO_TERM_COLOR: always
70-
run: npm run build-desktop
70+
run: cargo run build desktop
7171

7272
- name: Stage Artifacts
7373
shell: bash

.github/workflows/build-nix-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
- uses: DeterminateSystems/magic-nix-cache-action@main
1515

1616
- name: Build Nix Package Dev
17-
run: nix build .nix#graphite-dev --print-build-logs
17+
run: nix build .#graphite-dev --print-build-logs

.github/workflows/build-production.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ jobs:
5252
- name: 🌐 Build Graphite web code
5353
env:
5454
NODE_ENV: production
55-
run: |
56-
cd frontend
57-
mold -run npm run build
55+
run: mold -run cargo run build web
5856

5957
- name: 📤 Publish to Cloudflare Pages
6058
id: cloudflare

.github/workflows/build-win-bundle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ jobs:
7070
cargo binstall --no-confirm --force "wasm-bindgen-cli@$env:WASM_BINDGEN_CLI_VERSION"
7171
7272
- name: Build Windows Bundle
73+
shell: bash # `cargo-about` refuses to run in powershell
7374
env:
7475
CARGO_TERM_COLOR: always
75-
run: npm run build-desktop
76+
run: cargo run build desktop
7677

7778
- name: Stage Artifacts
7879
shell: bash

.github/workflows/ci.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: "CI"
2+
3+
on:
4+
pull_request: {}
5+
merge_group: {}
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
# Rust format check on GitHub runner
12+
rust-fmt:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: 📥 Clone and checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: 🚦 Check if CI can be skipped
19+
id: skip-check
20+
uses: cariad-tech/merge-queue-ci-skipper@main
21+
22+
- name: 🦀 Install the latest Rust
23+
if: steps.skip-check.outputs.skip-check != 'true'
24+
uses: dtolnay/rust-toolchain@stable
25+
with:
26+
components: rustfmt
27+
28+
- name: 🔬 Check Rust formatting
29+
if: steps.skip-check.outputs.skip-check != 'true'
30+
run: cargo fmt --all -- --check
31+
32+
# License compatibility check on GitHub runner
33+
cargo-deny:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: 📥 Clone and checkout repository
37+
uses: actions/checkout@v3
38+
39+
- name: 📜 Check crate license compatibility for root workspace
40+
uses: EmbarkStudios/cargo-deny-action@v2
41+
with:
42+
command: check bans licenses sources
43+
44+
- name: 📜 Check crate license compatibility for /libraries/rawkit
45+
uses: EmbarkStudios/cargo-deny-action@v2
46+
with:
47+
command: check bans licenses sources
48+
manifest-path: libraries/rawkit/Cargo.toml
49+
50+
# Build the web app on the self-hosted wasm runner
51+
build:
52+
runs-on: [self-hosted, target/wasm]
53+
permissions:
54+
contents: write
55+
deployments: write
56+
pull-requests: write
57+
actions: write
58+
env:
59+
RUSTC_WRAPPER: /usr/bin/sccache
60+
CARGO_INCREMENTAL: 0
61+
SCCACHE_DIR: /var/lib/github-actions/.cache
62+
63+
steps:
64+
- name: 📥 Clone and checkout repository
65+
uses: actions/checkout@v3
66+
67+
- name: 🚦 Check if CI can be skipped
68+
id: skip-check
69+
uses: cariad-tech/merge-queue-ci-skipper@main
70+
71+
- name: 🗑 Clear wasm-bindgen cache
72+
if: steps.skip-check.outputs.skip-check != 'true'
73+
run: rm -r ~/.cache/.wasm-pack || true
74+
75+
- name: 🟢 Install the latest Node.js
76+
if: steps.skip-check.outputs.skip-check != 'true'
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: "latest"
80+
81+
- name: 🚧 Install build dependencies
82+
if: steps.skip-check.outputs.skip-check != 'true'
83+
run: |
84+
cd frontend
85+
npm run setup
86+
87+
- name: 🦀 Install the latest Rust
88+
if: steps.skip-check.outputs.skip-check != 'true'
89+
run: |
90+
rustup update stable
91+
92+
- name: 🦀 Fetch Rust dependencies
93+
if: steps.skip-check.outputs.skip-check != 'true'
94+
run: |
95+
cargo fetch --locked
96+
97+
- name: 🌐 Build Graphite web code
98+
if: steps.skip-check.outputs.skip-check != 'true'
99+
env:
100+
NODE_ENV: production
101+
run: mold -run cargo run build web
102+
103+
- name: 📤 Publish to Cloudflare Pages
104+
if: steps.skip-check.outputs.skip-check != 'true'
105+
uses: cloudflare/pages-action@1
106+
continue-on-error: true
107+
with:
108+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
109+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
110+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
111+
projectName: graphite-dev
112+
directory: frontend/dist
113+
114+
- name: 👕 Lint Graphite web formatting
115+
if: steps.skip-check.outputs.skip-check != 'true'
116+
env:
117+
NODE_ENV: production
118+
run: |
119+
cd frontend
120+
npm run check
121+
122+
# Run the Rust tests on the self-hosted native runner
123+
test:
124+
runs-on: [self-hosted, target/native]
125+
env:
126+
RUSTC_WRAPPER: /usr/bin/sccache
127+
CARGO_INCREMENTAL: 0
128+
SCCACHE_DIR: /var/lib/github-actions/.cache
129+
130+
steps:
131+
- name: 📥 Clone and checkout repository
132+
uses: actions/checkout@v3
133+
134+
- name: 🚦 Check if CI can be skipped
135+
id: skip-check
136+
uses: cariad-tech/merge-queue-ci-skipper@main
137+
138+
- name: 🦀 Install the latest Rust
139+
if: steps.skip-check.outputs.skip-check != 'true'
140+
run: |
141+
rustup update stable
142+
143+
- name: 🦀 Fetch Rust dependencies
144+
if: steps.skip-check.outputs.skip-check != 'true'
145+
run: |
146+
cargo fetch --locked
147+
148+
- name: 🧪 Run Rust tests
149+
if: steps.skip-check.outputs.skip-check != 'true'
150+
env:
151+
RUSTFLAGS: -Dwarnings
152+
run: |
153+
mold -run cargo test --all-features

.github/workflows/comment-!build-commands.yml

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# USAGE:
22
# After reviewing the code, core team members may comment on a PR with the exact text:
3-
# - `!build-dev` to build with debug symbols and optimizations disabled
4-
# - `!build-profiling` to build with debug symbols and optimizations enabled
3+
# - `!build-debug` to build with debug symbols and optimizations disabled
54
# - `!build` to build without debug symbols and optimizations enabled
65
# The comment may not contain any other text, not even whitespace or newlines.
76
name: "!build PR Command"
@@ -21,7 +20,7 @@ jobs:
2120
if: >
2221
github.event.issue.pull_request &&
2322
github.event.comment.author_association == 'MEMBER' &&
24-
(github.event.comment.body == '!build-dev' || github.event.comment.body == '!build-profiling' || github.event.comment.body == '!build')
23+
(github.event.comment.body == '!build-debug' || github.event.comment.body == '!build')
2524
runs-on: self-hosted
2625
permissions:
2726
contents: read
@@ -82,22 +81,43 @@ jobs:
8281
- name: ⌨ Set build command based on comment
8382
id: build_command
8483
run: |
85-
if [[ "${{ github.event.comment.body }}" == "!build-dev" ]]; then
86-
echo "command=build-dev" >> $GITHUB_OUTPUT
87-
elif [[ "${{ github.event.comment.body }}" == "!build-profiling" ]]; then
88-
echo "command=build-profiling" >> $GITHUB_OUTPUT
84+
if [[ "${{ github.event.comment.body }}" == "!build-debug" ]]; then
85+
echo "command=build web debug" >> $GITHUB_OUTPUT
8986
elif [[ "${{ github.event.comment.body }}" == "!build" ]]; then
90-
echo "command=build" >> $GITHUB_OUTPUT
87+
echo "command=build web" >> $GITHUB_OUTPUT
9188
else
92-
echo "Failed to detect if the build command written in the comment should have been '!build-dev', '!build-profiling', or '!build'" >> $GITHUB_OUTPUT
89+
echo "Failed to detect if the build command written in the comment should have been '!build-debug', or '!build'" >> $GITHUB_OUTPUT
9390
fi
9491
92+
- name: 💬 Comment Actions run link
93+
id: comment_actions_run_link
94+
uses: actions/github-script@v6
95+
with:
96+
script: |
97+
github.rest.issues.updateComment({
98+
comment_id: ${{ github.event.comment.id }},
99+
owner: context.repo.owner,
100+
repo: context.repo.repo,
101+
body: '!build ([Run ID ' + context.runId + '](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + '))'
102+
});
103+
95104
- name: 🌐 Build Graphite web code
96105
env:
97106
NODE_ENV: production
98-
run: |
99-
cd frontend
100-
mold -run npm run ${{ steps.build_command.outputs.command }}
107+
if: ${{ success() || failure()}}
108+
run: mold -run cargo run ${{ steps.build_command.outputs.command }}
109+
110+
- name: ❗ Warn on build failure
111+
if: ${{ failure() }}
112+
uses: actions/github-script@v6
113+
with:
114+
script: |
115+
github.rest.issues.createComment({
116+
issue_number: context.issue.number,
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
body: 'The build process has failed. Please check the [build logs](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + ') for details.'
120+
});
101121
102122
- name: 📤 Publish to Cloudflare Pages
103123
id: cloudflare
@@ -110,6 +130,18 @@ jobs:
110130
projectName: graphite-dev
111131
directory: frontend/dist
112132

133+
- name: ❗ Warn on publish failure
134+
if: ${{ failure() }}
135+
uses: actions/github-script@v6
136+
with:
137+
script: |
138+
github.rest.issues.createComment({
139+
issue_number: context.issue.number,
140+
owner: context.repo.owner,
141+
repo: context.repo.repo,
142+
body: 'The deployment to Cloudflare Pages has failed. Please check the [build logs](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + ') for details.
143+
});
144+
113145
- name: 💬 Comment build link
114146
uses: actions/github-script@v6
115147
with:

.github/workflows/comment-profiling-changes.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Profiling Changes
33
on:
44
pull_request:
55
paths:
6-
- 'node-graph/**'
7-
- 'Cargo.toml'
8-
- 'Cargo.lock'
6+
- "node-graph/**"
7+
- "Cargo.toml"
8+
- "Cargo.lock"
99

1010
env:
1111
CARGO_TERM_COLOR: always
@@ -200,7 +200,7 @@ jobs:
200200
let commentBody = "";
201201
202202
function formatNumber(num) {
203-
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
203+
return String(num).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
204204
}
205205
206206
function formatPercentage(pct) {

0 commit comments

Comments
 (0)