diff options
author | jade <lix@jade.fyi> | 2024-06-09 08:28:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-06-09 08:28:52 +0000 |
commit | 7dfa2a761ef8856454d8f63eda27edb8984bdc98 (patch) | |
tree | 310486149aa9955676a0ee43eca0b873357962b7 /releng/release-jobs.nix | |
parent | 28a079f841834ac11105ce5762115904d1e40ce1 (diff) | |
parent | 98e847514795f53f485b6dbd029ecb545ce38236 (diff) |
Merge changes from topic "releng" into main
* changes:
releng: support pushing the manual to docs also
Expose officialRelease from the flake
Put into place initial release engineering
Diffstat (limited to 'releng/release-jobs.nix')
-rw-r--r-- | releng/release-jobs.nix | 57 |
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; +} |