aboutsummaryrefslogtreecommitdiff
path: root/releng/release-jobs.nix
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-05-31 16:35:13 -0700
committerJade Lovelace <lix@jade.fyi>2024-06-06 20:53:08 -0700
commitc32a01f9ebae026c1b7b8ba081411581453b4624 (patch)
treec246e14bc178bfa1ea2ad6fe6487d80b528a31dc /releng/release-jobs.nix
parent611b1de441a54d3ed7781ca0a26b51b6cb9c45cc (diff)
Put into place initial release engineering
This can release x86_64-linux binaries to staging, with ephemeral keys. I think it's good enough to review at least at this point, so we don't keep adding more stuff to it to make it harder to review. Change-Id: Ie95e8f35d1252f5d014e819566f170b30eda152e
Diffstat (limited to 'releng/release-jobs.nix')
-rw-r--r--releng/release-jobs.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/releng/release-jobs.nix b/releng/release-jobs.nix
new file mode 100644
index 000000000..e693a3a81
--- /dev/null
+++ b/releng/release-jobs.nix
@@ -0,0 +1,57 @@
+{ hydraJobs, pkgs }:
+let
+ inherit (pkgs) lib;
+ lix = hydraJobs.build.x86_64-linux;
+
+ systems = [ "x86_64-linux" ];
+ dockerSystems = [ "x86_64-linux" ];
+
+ doTarball =
+ {
+ target,
+ targetName,
+ rename ? null,
+ }:
+ ''
+ echo "doing: ${target}"
+ # expand wildcard
+ filename=$(echo ${target}/${targetName})
+ basename="$(basename $filename)"
+
+ echo $filename $basename
+ cp -v "$filename" "$out"
+ ${lib.optionalString (rename != null) ''
+ mv "$out/$basename" "$out/${rename}"
+ basename="${rename}"
+ ''}
+ sha256sum --binary $filename | cut -f1 -d' ' > $out/$basename.sha256
+ '';
+
+ targets =
+ builtins.map (system: {
+ target = hydraJobs.binaryTarball.${system};
+ targetName = "*.tar.xz";
+ }) systems
+ ++ builtins.map (system: {
+ target = hydraJobs.dockerImage.${system};
+ targetName = "image.tar.gz";
+ rename = "lix-${lix.version}-docker-image-${system}.tar.gz";
+ }) dockerSystems;
+
+ manualTar = pkgs.runCommand "lix-manual-tarball" { } ''
+ mkdir -p $out
+ cp -r ${lix.doc}/share/doc/nix/manual lix-${lix.version}-manual
+ 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
+ '';
+in
+{
+ inherit (hydraJobs) build;
+ inherit tarballs;
+}