From 8f1eb162b9bd6b3d66912f0c5e24d9006c034504 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Aug 2021 23:36:35 +0200 Subject: [PATCH] ci: setup cachix for flake package outputs --- .github/workflows/build-flake-packages.sh | 14 ++++++++++++++ .github/workflows/cachix.yaml | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 .github/workflows/build-flake-packages.sh create mode 100644 .github/workflows/cachix.yaml diff --git a/.github/workflows/build-flake-packages.sh b/.github/workflows/build-flake-packages.sh new file mode 100755 index 0000000..9f387c8 --- /dev/null +++ b/.github/workflows/build-flake-packages.sh @@ -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 diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml new file mode 100644 index 0000000..7a47d30 --- /dev/null +++ b/.github/workflows/cachix.yaml @@ -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