ci: setup cachix for flake package outputs

This commit is contained in:
Antoine Martin 2021-08-19 23:36:35 +02:00
parent f52e426817
commit 8f1eb162b9
2 changed files with 37 additions and 0 deletions

14
.github/workflows/build-flake-packages.sh vendored Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -xe
PACKAGES=$(nix flake show \
| grep ': package' \
| sed 's/\x1b\[[0-9;]*m//g' \
| sed -E 's/^.*───([A-Za-z/"-]+):.*$/\1/' \
| sort \
| uniq)
for package in $PACKAGES; do
nix build --verbose .#$package
done

23
.github/workflows/cachix.yaml vendored Normal file
View file

@ -0,0 +1,23 @@
name: "Build packages for cachix"
on:
push:
paths:
- 'pkgs/**'
- 'flake.nix'
- 'flake.lock'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v13
with:
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v10
with:
name: alarsyo
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: .github/workflows/build-flake-packages.sh