From b091275efd5a9a72ca88d65479cf0a6883789e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Tue, 9 Jun 2026 16:39:40 +0200 Subject: [PATCH] ci: Build packages on push to main --- .envrc | 1 + .gitea/workflows/cache.yaml | 31 +++++++++++++++++++ .gitignore | 2 ++ .../sphinx-last-updated-by-git/default.nix | 2 ++ default.nix | 2 +- shell.nix | 1 + 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/cache.yaml diff --git a/.envrc b/.envrc index 21dccbd..1ab4260 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,3 @@ # shellcheck shell=bash +dotenv_if_exists use nix diff --git a/.gitea/workflows/cache.yaml b/.gitea/workflows/cache.yaml new file mode 100644 index 0000000..8f64fc7 --- /dev/null +++ b/.gitea/workflows/cache.yaml @@ -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" diff --git a/.gitignore b/.gitignore index 3cb44c3..319a916 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ result-* # Ignore automatically generated direnv output .direnv +.env +niks3-token diff --git a/by-name/sphinx-last-updated-by-git/default.nix b/by-name/sphinx-last-updated-by-git/default.nix index 4b00647..8f39c7e 100644 --- a/by-name/sphinx-last-updated-by-git/default.nix +++ b/by-name/sphinx-last-updated-by-git/default.nix @@ -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 ]; } diff --git a/default.nix b/default.nix index 4b00065..b24a567 100644 --- a/default.nix +++ b/default.nix @@ -18,7 +18,7 @@ let mkPackages = fun: dir: - builtins.map (name: { + map (name: { inherit name; value = fun (dir + "/${name}") { }; }) (listDirs dir); diff --git a/shell.nix b/shell.nix index 5105b17..6ee2d22 100644 --- a/shell.nix +++ b/shell.nix @@ -8,6 +8,7 @@ in pkgs.mkShellNoCC { packages = [ pkgs.npins + pkgs.niks3 pkgs.nix-init pkgs.nix-update treefmt