ci: sync the shared CI tasks

Make cargoToolchain optional in nix/ci-tasks.nix, so repositories without
Rust use the same file, and add a copy-build-output task that copies a build
result into the checkout as writable files. The shared files in ci/ and
nix/ci-tasks.nix stay identical across repositories.

Claude-Session: https://claude.ai/code/session_01D8dLLgYd8cfR2aQfA5eZXa
This commit is contained in:
Willem Vanhulle committed 2026-11-05 20:45:36 +01:00
1 parent f9f68b2a68
commit d41120e263
2 files changed
+29 -10

No files matched your search

+14
View File
@@ -74,6 +74,20 @@ def "main upload-exported-paths" []: nothing -> nothing {
} }
} }
def "main copy-build-output" [
build_output: path
destination: path
]: nothing -> nothing {
if ($build_output | path expand | path type) == dir {
mkdir $destination
for output_entry in (ls $build_output | get name) {
cp --recursive --preserve [] $output_entry $destination
}
} else {
cp --preserve [] $build_output $destination
}
}
def main []: nothing -> nothing { def main []: nothing -> nothing {
print "Run a subcommand, for example: build-and-export-paths" print "Run a subcommand, for example: build-and-export-paths"
} }
+15 -10
View File
@@ -1,14 +1,16 @@
{ {
pkgs, pkgs,
mkApp, mkApp,
cargoToolchain, cargoToolchain ? null,
preCommitInputs, preCommitInputs ? [ ],
extraReleaseInputs ? [ ], extraReleaseInputs ? [ ],
releaseWrapperArgs ? [ ], releaseWrapperArgs ? [ ],
}: }:
let let
inherit (pkgs) lib; inherit (pkgs) lib;
cargoInputs = lib.optional (cargoToolchain != null) cargoToolchain;
nuScriptTool = nuScriptTool =
{ {
script, script,
@@ -49,12 +51,13 @@ let
mkApp (nuScriptTool { mkApp (nuScriptTool {
inherit name; inherit name;
script = ../ci/release-tasks.nu; script = ../ci/release-tasks.nu;
runtimeInputs = [ runtimeInputs =
cargoToolchain cargoInputs
pkgs.release-plz ++ [
pkgs.gitMinimal pkgs.release-plz
] pkgs.gitMinimal
++ extraReleaseInputs; ]
++ extraReleaseInputs;
wrapperArgs = releaseWrapperArgs; wrapperArgs = releaseWrapperArgs;
}); });
@@ -96,8 +99,7 @@ releaseTaskApps
open-dependency-update-pr = mkApp (nuScriptTool { open-dependency-update-pr = mkApp (nuScriptTool {
name = "open-dependency-update-pr"; name = "open-dependency-update-pr";
script = ../ci/dependency-updates.nu; script = ../ci/dependency-updates.nu;
runtimeInputs = [ runtimeInputs = cargoInputs ++ [
cargoToolchain
pkgs.gitMinimal pkgs.gitMinimal
pkgs.tea pkgs.tea
]; ];
@@ -108,6 +110,9 @@ releaseTaskApps
import-exported-paths = mkApp (nixBuiltPathsTool { import-exported-paths = mkApp (nixBuiltPathsTool {
name = "import-exported-paths"; name = "import-exported-paths";
}); });
copy-build-output = mkApp (nixBuiltPathsTool {
name = "copy-build-output";
});
upload-exported-paths = mkApp (nixBuiltPathsTool { upload-exported-paths = mkApp (nixBuiltPathsTool {
name = "upload-exported-paths"; name = "upload-exported-paths";
runtimeInputs = [ pkgs.cachix ]; runtimeInputs = [ pkgs.cachix ];