Desktop: Push builds to Nix binary cache in CI (#3740)
Desktop: Add Nix Cache
This commit is contained in:
parent
0f10c242e2
commit
9633de5929
|
|
@ -1,10 +1,16 @@
|
||||||
name: Build Linux Bundle
|
name: Build Linux Bundle
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: {}
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
push_to_cache:
|
||||||
|
description: "Push to Nix Cache"
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -14,11 +20,21 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
||||||
|
|
||||||
- name: Free disk space
|
- name: Free disk space
|
||||||
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
|
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
|
- name: Build Linux Bundle
|
||||||
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
|
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue