Skip to content

Commit 9633de5

Browse files
Desktop: Push builds to Nix binary cache in CI (#3740)
Desktop: Add Nix Cache
1 parent 0f10c24 commit 9633de5

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: Build Linux Bundle
22

33
on:
4-
workflow_dispatch: {}
54
push:
65
branches:
76
- master
7+
workflow_dispatch:
8+
inputs:
9+
push_to_cache:
10+
description: "Push to Nix Cache"
11+
required: false
12+
type: boolean
13+
default: false
814

915
jobs:
1016
build:
@@ -14,11 +20,21 @@ jobs:
1420
steps:
1521
- uses: actions/checkout@v4
1622
- uses: DeterminateSystems/nix-installer-action@main
17-
- uses: DeterminateSystems/magic-nix-cache-action@main
1823

1924
- name: Free disk space
2025
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
2126

27+
- name: Build Nix Package
28+
run: nix build .nix --no-link --print-out-paths
29+
30+
- name: Push to Nix Cache
31+
if: github.ref == 'refs/heads/master' || inputs.push_to_cache == true
32+
env:
33+
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
34+
run: |
35+
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
36+
nix build .nix --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
37+
2238
- name: Build Linux Bundle
2339
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
2440

0 commit comments

Comments
 (0)