aboutsummaryrefslogtreecommitdiff
path: root/releng/release-jobs.nix
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-06-13 14:03:27 -0700
committerJade Lovelace <lix@jade.fyi>2024-06-13 14:36:03 -0700
commit74fb2e8c47cbcb3fe9dff417b5ce61550588708f (patch)
treeece2295892b180c52cc15ce9460b4e0b11eed272 /releng/release-jobs.nix
parentac28cff28f7d979c2b90f737839635f27f048eb4 (diff)
releng: support multiple systems
I guess this is kind of important to being able to "release it". Change-Id: Id6f295d0b4944fa1203783a400a246727dbd94b6
Diffstat (limited to 'releng/release-jobs.nix')
-rw-r--r--releng/release-jobs.nix54
1 files changed, 43 insertions, 11 deletions
diff --git a/releng/release-jobs.nix b/releng/release-jobs.nix
index 4db0baed3..49508e4ef 100644
--- a/releng/release-jobs.nix
+++ b/releng/release-jobs.nix
@@ -3,8 +3,27 @@ let
inherit (pkgs) lib;
lix = hydraJobs.build.x86_64-linux;
- systems = [ "x86_64-linux" ];
- dockerSystems = [ "x86_64-linux" ];
+ # This is all so clumsy because we can't use arguments to functions in
+ # flakes, and certainly not with n-e-j.
+ profiles = {
+ # Used for testing
+ x86_64-linux-only = {
+ systems = [ "x86_64-linux" ];
+ dockerSystems = [ "x86_64-linux" ];
+ };
+ all = {
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "aarch64-darwin"
+ "x86_64-darwin"
+ ];
+ dockerSystems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ ];
+ };
+ };
doTarball =
{
@@ -27,7 +46,8 @@ let
sha256sum --binary $filename | cut -f1 -d' ' > $out/$basename.sha256
'';
- targets =
+ targetsFor =
+ { systems, dockerSystems }:
builtins.map (system: {
target = hydraJobs.binaryTarball.${system};
targetName = "*.tar.xz";
@@ -44,14 +64,26 @@ let
tar -cvzf "$out/lix-${lix.version}-manual.tar.gz" lix-${lix.version}-manual
'';
- tarballs = pkgs.runCommand "lix-release-tarballs" { } ''
- mkdir -p $out
- ${lib.concatMapStringsSep "\n" doTarball targets}
- cp ${manualTar}/*.tar.gz $out
- cp -r ${lix.doc}/share/doc/nix/manual $out
- '';
+ tarballsFor =
+ { systems, dockerSystems }:
+ pkgs.runCommand "lix-release-tarballs" { } ''
+ mkdir -p $out
+ ${lib.concatMapStringsSep "\n" doTarball (targetsFor {
+ inherit systems dockerSystems;
+ })}
+ cp ${manualTar}/*.tar.gz $out
+ cp -r ${lix.doc}/share/doc/nix/manual $out
+ '';
in
-{
+(builtins.mapAttrs (
+ _:
+ { systems, dockerSystems }:
+ {
+ build = lib.filterAttrs (x: _: builtins.elem x systems) hydraJobs.build;
+ tarballs = tarballsFor { inherit systems dockerSystems; };
+ }
+) profiles)
+// {
inherit (hydraJobs) build;
- inherit tarballs;
+ inherit tarballsFor;
}