ci: Build packages on push to main
Cache / build-and-push (push) Successful in 3m24s

This commit is contained in:
2026-06-09 16:39:40 +02:00
parent 0ecb3a5094
commit b091275efd
6 changed files with 38 additions and 1 deletions
+1
View File
@@ -1,2 +1,3 @@
# shellcheck shell=bash
dotenv_if_exists
use nix
+31
View File
@@ -0,0 +1,31 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
name: Cache
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-and-push:
runs-on: nix
steps:
- uses: actions/checkout@v6
- name: Write niks3 auth token
run: |
umask 077
printf '%s' "${{ secrets.NIKS3_AUTH_TOKEN }}" > "$RUNNER_TEMP/niks3-auth-token"
- name: Build all packages
run: |
nix-build --no-out-link | tee "$RUNNER_TEMP/built-paths"
- name: Push to niks3 cache
env:
NIKS3_SERVER_URL: https://cache.ekman.oceanbox.io
NIKS3_AUTH_TOKEN_FILE: ${{ runner.temp }}/niks3-auth-token
run: |
niks3="$(nix --extra-experimental-features 'nix-command flakes' \
build --no-link --print-out-paths 'github:Mic92/niks3/v1.6.1#niks3')/bin/niks3"
xargs -r "$niks3" push < "$RUNNER_TEMP/built-paths"
+2
View File
@@ -6,3 +6,5 @@ result-*
# Ignore automatically generated direnv output
.direnv
.env
niks3-token
@@ -46,5 +46,7 @@ python3Packages.buildPythonPackage {
"test_repo_shallow"
"test_repo_shallow_without_warning"
"test_exclude_patterns_deps_dates" # broken at this rev: exclude pattern on deps doesn't fall back correctly
];
}
+1 -1
View File
@@ -18,7 +18,7 @@ let
mkPackages =
fun: dir:
builtins.map (name: {
map (name: {
inherit name;
value = fun (dir + "/${name}") { };
}) (listDirs dir);
+1
View File
@@ -8,6 +8,7 @@ in
pkgs.mkShellNoCC {
packages = [
pkgs.npins
pkgs.niks3
pkgs.nix-init
pkgs.nix-update
treefmt