Skip to content

Commit 49807ad

Browse files
authored
Merge branch 'master' into documentMode-extension
2 parents 268ec73 + b100892 commit 49807ad

File tree

124 files changed

+4191
-1929
lines changed

Some content is hidden

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

124 files changed

+4191
-1929
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/8ae15dc9c51a3855475d8cab1d0f29d9d9bc622c.tar.gz
2-
c19abe4ac848f3c835e43dc065c59e20e60233ae023ea0a064c5fed442be2d3d
1+
https://github.com/Keavon/graphite-branded-assets/archive/1509880500e32cb21235343ba865adcf0579133f.tar.gz
2+
89b4c58aee186b0c1610a8778bd199c9bdaf1191b4006e6b007dc40a402f4aa7

.github/workflows/build.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ on:
2020
linux:
2121
description: "Linux"
2222
type: boolean
23-
push_to_nix_cache:
24-
description: "Linux: push to Nix cache"
25-
type: boolean
2623
debug:
2724
description: "Debug build"
2825
type: boolean
@@ -36,8 +33,6 @@ on:
3633
type: boolean
3734
linux:
3835
type: boolean
39-
push_to_nix_cache:
40-
type: boolean
4136
debug:
4237
type: boolean
4338
checkout_repo:
@@ -162,7 +157,7 @@ jobs:
162157
REF="master"
163158
ENVIRONMENT="graphite-dev (Production)"
164159
else
165-
REF="${{ inputs.checkout_ref || github.head_ref || github.ref_name }}"
160+
REF="$(git rev-parse HEAD)"
166161
ENVIRONMENT="graphite-dev (Preview)"
167162
fi
168163
DEPLOY_ID=$(gh api \
@@ -639,23 +634,35 @@ jobs:
639634

640635
- name: ❄ Install Nix
641636
uses: DeterminateSystems/nix-installer-action@main
637+
with:
638+
extra-conf: |
639+
extra-substituters = https://graphite.cachix.org https://graphite-dev.cachix.org
640+
extra-trusted-public-keys = graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo= graphite-dev.cachix.org-1:RppXYpiV1qO2TYKTkXXGHsAEQDOB5G51b3VlrN9QmbI=
642641
643642
- name: 🗑 Free disk space
644643
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
645644

646645
- name: 📦 Build Nix package
647-
run: nix build .#graphite${{ inputs.debug && '-dev' || '' }} --no-link --print-out-paths
646+
run: nix build .#graphite${{ inputs.debug && '-dev' || '' }} --no-link --print-out-paths --print-build-logs
648647

649648
- name: 📤 Push to Nix cache
650-
if: (github.event_name == 'push' || inputs.push_to_nix_cache) && !inputs.debug
651649
env:
652-
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
650+
NIX_CACHE_AUTH_TOKEN: ${{ (!inputs.debug && github.ref == 'refs/heads/master') && secrets.NIX_CACHE_AUTH_TOKEN || secrets.NIX_CACHE_AUTH_TOKEN_DEV }}
651+
NIX_CACHE_NAME: ${{ (!inputs.debug && github.ref == 'refs/heads/master') && 'graphite' || 'graphite-dev' }}
652+
run: |
653+
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
654+
nix build .#graphite${{ inputs.debug && '-dev' || '' }} --no-link --print-out-paths | nix run nixpkgs#cachix -- push $NIX_CACHE_NAME
655+
656+
- name: 📤 Push Dependencies to dev Nix cache
657+
env:
658+
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN_DEV }}
659+
NIX_CACHE_NAME: graphite-dev
653660
run: |
654661
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
655-
nix build --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
662+
nix build .#graphite${{ inputs.debug && '-dev' || '' }}.deps --no-link --print-out-paths | nix run nixpkgs#cachix -- push $NIX_CACHE_NAME
656663
657664
- name: 🏗 Build Linux bundle
658-
run: nix build .#graphite${{ inputs.debug && '-dev' || '' }}-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
665+
run: nix build .#graphite-bundle${{ inputs.debug && '-dev' || '' }}.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
659666

660667
- name: 📦 Upload Linux bundle
661668
uses: actions/upload-artifact@v6
@@ -693,7 +700,7 @@ jobs:
693700
694701
- name: 🏗 Build Flatpak
695702
run: |
696-
nix build .#graphite${{ inputs.debug && '-dev' || '' }}-flatpak-manifest
703+
nix build .#graphite-flatpak-manifest${{ inputs.debug && '-dev' || '' }}
697704
698705
rm -rf .flatpak
699706
mkdir -p .flatpak

.github/workflows/nix.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Nix Housekeeping"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch: {}
8+
9+
jobs:
10+
cache-dev-shell:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: 📥 Clone repository
17+
uses: actions/checkout@v6
18+
with:
19+
repository: ${{ inputs.checkout_repo || github.repository }}
20+
ref: ${{ inputs.checkout_ref || '' }}
21+
22+
- name: ❄ Install Nix
23+
uses: DeterminateSystems/nix-installer-action@main
24+
with:
25+
extra-conf: |
26+
extra-substituters = https://graphite.cachix.org https://graphite-dev.cachix.org
27+
extra-trusted-public-keys = graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo= graphite-dev.cachix.org-1:RppXYpiV1qO2TYKTkXXGHsAEQDOB5G51b3VlrN9QmbI=
28+
29+
- name: 🔎 Check whether development shell is already in binary cache
30+
id: cache-check
31+
run: |
32+
out_path="$(nix eval --raw .#devShells.x86_64-linux.default.outPath)"
33+
if nix path-info --store https://graphite-dev.cachix.org "$out_path" &>/dev/null; then
34+
echo "cached=true" >> "$GITHUB_OUTPUT"
35+
echo "Development shell is already cached at $out_path"
36+
else
37+
echo "cached=false" >> "$GITHUB_OUTPUT"
38+
echo "Development shell is not cached"
39+
fi
40+
41+
- name: 📦 Build Nix development shell
42+
if: steps.cache-check.outputs.cached == 'false'
43+
run: nix build .#devShells.x86_64-linux.default --no-link --print-out-paths
44+
45+
- name: 📤 Push Nix development shell to binary cache
46+
if: steps.cache-check.outputs.cached == 'false'
47+
env:
48+
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN_DEV }}
49+
run: |
50+
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
51+
nix build .#devShells.x86_64-linux.default --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite-dev

.github/workflows/provide-shaders.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717

1818
- name: ❄ Install Nix
1919
uses: DeterminateSystems/nix-installer-action@main
20-
21-
- name: 💾 Set up Nix cache
22-
uses: DeterminateSystems/magic-nix-cache-action@main
20+
with:
21+
extra-conf: |
22+
extra-substituters = https://graphite.cachix.org https://graphite-dev.cachix.org
23+
extra-trusted-public-keys = graphite.cachix.org-1:B7Il1yMpkquN/dXM+5GRmz+4Xmu2aaCS1GcWNfFhsOo= graphite-dev.cachix.org-1:RppXYpiV1qO2TYKTkXXGHsAEQDOB5G51b3VlrN9QmbI=
2324
2425
- name: 🏗 Build graphene raster nodes shaders
2526
run: nix build .#graphite-raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl
@@ -34,3 +35,11 @@ jobs:
3435
raster_nodes_shaders_entrypoint.wgsl \
3536
"${{ github.sha }} raster_nodes_shaders_entrypoint.wgsl" \
3637
${{ secrets.ARTIFACTS_REPO_TOKEN }}
38+
39+
- name: 📤 Push shaders to dev Nix cache
40+
env:
41+
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN_DEV }}
42+
NIX_CACHE_NAME: graphite-dev
43+
run: |
44+
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
45+
nix build .#graphite-raster-nodes-shaders --no-link --print-out-paths | nix run nixpkgs#cachix -- push $NIX_CACHE_NAME

.nix/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ in
6060
graphite-raster-nodes-shaders = lib.call ./pkgs/graphite-raster-nodes-shaders.nix;
6161
graphite-branding = lib.call ./pkgs/graphite-branding.nix;
6262
graphite-bundle = (lib.call ./pkgs/graphite-bundle.nix) { };
63-
graphite-dev-bundle = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
63+
graphite-bundle-dev = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
6464
graphite-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { };
65-
graphite-dev-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-dev-bundle; };
65+
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-bundle-dev; };
6666

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

.nix/deps/crane.nix

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
{ pkgs, inputs, ... }:
1+
{
2+
pkgs,
3+
inputs,
4+
...
5+
}:
26

37
{
4-
lib = inputs.crane.mkLib pkgs;
8+
lib = (inputs.crane.mkLib pkgs) // {
9+
vendorCargoDepsFlatten =
10+
src:
11+
pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
12+
name = "graphite-cargo-vendored";
13+
inherit src;
14+
15+
installPhase = ''
16+
cp -rL --no-preserve=mode "$src" "$out"
17+
chmod -R u+w "$out"
18+
find "$out" -type f -print0 | xargs -r -0 sed -i "s|$src|$out|g"
19+
'';
20+
21+
disallowedReferences = [ finalAttrs.src ];
22+
23+
dontUnpack = true;
24+
dontConfigure = true;
25+
dontBuild = true;
26+
});
27+
};
528
}

.nix/pkgs/graphite-raster-nodes-shaders.nix

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{ info, deps, ... }:
1+
{
2+
info,
3+
deps,
4+
self,
5+
system,
6+
...
7+
}:
28

39
(deps.crane.lib.overrideToolchain (_: deps.rustGPU.toolchain)).buildPackage {
4-
pname = "raster-nodes-shaders";
10+
pname = "graphite-raster-nodes-shaders";
511
inherit (info) version src;
612

7-
cargoVendorDir = deps.crane.lib.vendorMultipleCargoDeps {
8-
inherit (deps.crane.lib.findCargoFiles (deps.crane.lib.cleanCargoSource info.src)) cargoConfigs;
9-
cargoLockList = [
10-
"${info.src}/Cargo.lock"
11-
"${deps.rustGPU.toolchain.availableComponents.rust-src}/lib/rustlib/src/rust/library/Cargo.lock"
12-
];
13-
};
13+
inherit (self.packages.${system}.graphite) cargoVendorDir cargoArtifacts;
1414

1515
strictDeps = true;
1616

0 commit comments

Comments
 (0)