Skip to content
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/build-linux-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache

- name: Build Nix Package
run: nix build .nix --no-link --print-out-paths
run: nix build --no-link --print-out-paths

- name: Push to Nix Cache
if: github.ref == 'refs/heads/master' || inputs.push_to_cache == true
env:
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
run: |
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
nix build .nix --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
nix build --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite

- name: Build Linux Bundle
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
run: nix build .#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz

- name: Upload Linux Bundle
uses: actions/upload-artifact@v4
Expand All @@ -53,7 +53,7 @@ jobs:

- name: Build Flatpak
run: |
nix build .nix#graphite-flatpak-manifest
nix build .#graphite-flatpak-manifest

rm -rf .flatpak
mkdir -p .flatpak
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mac-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Build Mac Bundle
env:
CARGO_TERM_COLOR: always
run: npm run build-desktop
run: cargo run desktop build

- name: Stage Artifacts
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-nix-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build Nix Package Dev
run: nix build .nix#graphite-dev --print-build-logs
run: nix build .#graphite-dev --print-build-logs
4 changes: 1 addition & 3 deletions .github/workflows/build-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ jobs:
- name: 🌐 Build Graphite web code
env:
NODE_ENV: production
run: |
cd frontend
mold -run npm run build
run: mold -run cargo run web build

- name: 📤 Publish to Cloudflare Pages
id: cloudflare
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-win-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
shell: bash # `cargo-about` refuses to run in powershell
env:
CARGO_TERM_COLOR: always
run: npm run build-desktop
run: cargo run desktop build

- name: Stage Artifacts
shell: bash
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
if: steps.skip-check.outputs.skip-check != 'true'
uses: actions/setup-node@v4
with:
node-version: 'latest'
node-version: "latest"

- name: 🚧 Install build dependencies
if: steps.skip-check.outputs.skip-check != 'true'
Expand All @@ -98,9 +98,7 @@ jobs:
if: steps.skip-check.outputs.skip-check != 'true'
env:
NODE_ENV: production
run: |
cd frontend
mold -run npm run build
run: mold -run cargo run web build

- name: 📤 Publish to Cloudflare Pages
if: steps.skip-check.outputs.skip-check != 'true'
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/comment-!build-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ jobs:
- name: ⌨ Set build command based on comment
id: build_command
run: |
if [[ "${{ github.event.comment.body }}" == "!build-dev" ]]; then
echo "command=build-dev" >> $GITHUB_OUTPUT
if [[ "${{ github.event.comment.body }}" == "!build-debug" ]]; then
echo "command=build debug" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.comment.body }}" == "!build-profiling" ]]; then
echo "command=build-profiling" >> $GITHUB_OUTPUT
echo "command=build profiling" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.comment.body }}" == "!build" ]]; then
echo "command=build" >> $GITHUB_OUTPUT
else
Expand All @@ -108,9 +108,7 @@ jobs:
env:
NODE_ENV: production
if: ${{ success() || failure()}}
run: |
cd frontend
mold -run npm run ${{ steps.build_command.outputs.command }}
run: mold -run cargo run web ${{ steps.build_command.outputs.command }}

- name: ❗ Warn on build failure
if: ${{ failure() }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/deploy-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: 🟢 Install the latest Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
node-version: latest

- name: 🚧 Install build dependencies
run: |
Expand All @@ -49,9 +49,7 @@ jobs:
- name: 🌐 Build Graphite web code
env:
NODE_ENV: production
run: |
cd frontend
mold -run npm run build
run: mold -run cargo run web build

- name: 📤 Publish to Cloudflare Pages
id: cloudflare
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/provide-shaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build graphene raster nodes shaders
run: nix build .nix#graphite-raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl
run: nix build .#graphite-raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl

- name: Upload graphene raster nodes shaders to artifacts repository
run: |
Expand Down
81 changes: 81 additions & 0 deletions .nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
inputs:

let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: inputs.nixpkgs.lib.genAttrs systems (system: f system);
args =
system:
(
let
lib = inputs.nixpkgs.lib // {
call = p: import p args;
};

pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

info = {
pname = "graphite";
version = "unstable";
src = inputs.nixpkgs.lib.cleanSourceWith {
src = ./..;
filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
};
cargoVendored = deps.crane.lib.vendorCargoDeps { inherit (info) src; };
};

deps = {
crane = lib.call ./deps/crane.nix;
cef = lib.call ./deps/cef.nix;
rustGPU = lib.call ./deps/rust-gpu.nix;
};

args = {
inherit system;
inherit (inputs) self;
inherit inputs;
inherit pkgs;
inherit lib;
inherit info;
inherit deps;
}
// inputs;
in
args
);
withArgs = f: forAllSystems (system: f (args system));
in
{
packages = withArgs (
{ lib, ... }:
rec {
default = graphite;
graphite = (lib.call ./pkgs/graphite.nix) { };
graphite-dev = (lib.call ./pkgs/graphite.nix) { dev = true; };
graphite-raster-nodes-shaders = lib.call ./pkgs/graphite-raster-nodes-shaders.nix;
graphite-branding = lib.call ./pkgs/graphite-branding.nix;
graphite-bundle = lib.call ./pkgs/graphite-bundle.nix;
graphite-flatpak-manifest = lib.call ./pkgs/graphite-flatpak-manifest.nix;

# TODO: graphene-cli = lib.call ./pkgs/graphene-cli.nix;

tools = {
third-party-licenses = lib.call ./pkgs/tools/third-party-licenses.nix;
};
}
);

devShells = withArgs (
{ lib, ... }:
{
default = lib.call ./dev.nix;
}
);

formatter = withArgs ({ pkgs, ... }: pkgs.nixfmt-tree);
}
110 changes: 0 additions & 110 deletions .nix/flake.nix

This file was deleted.

28 changes: 0 additions & 28 deletions .nix/shell.nix

This file was deleted.

5 changes: 5 additions & 0 deletions Cargo.lock

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

Loading