From a399eb0bf241dcb82a8fe424592c0d02d6bb93a6 Mon Sep 17 00:00:00 2001 From: Timon Date: Mon, 9 Feb 2026 16:06:56 +0000 Subject: [PATCH] Desktop: Add Nix Cache --- .github/workflows/build-linux-bundle.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux-bundle.yml b/.github/workflows/build-linux-bundle.yml index 4b07e490b2..919bd126f8 100644 --- a/.github/workflows/build-linux-bundle.yml +++ b/.github/workflows/build-linux-bundle.yml @@ -1,10 +1,16 @@ name: Build Linux Bundle on: - workflow_dispatch: {} push: branches: - master + workflow_dispatch: + inputs: + push_to_cache: + description: "Push to Nix Cache" + required: false + type: boolean + default: false jobs: build: @@ -14,11 +20,21 @@ jobs: steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - name: Free disk space 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 + + - 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 + - name: Build Linux Bundle run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz