forked from IntersectMBO/cardano-addresses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
61 lines (57 loc) · 2.1 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
############################################################################
#
# Hydra release jobset.
#
# The purpose of this file is to select jobs defined in default.nix and map
# them to all supported build platforms.
#
############################################################################
# The project sources
{ cardano-addresses ? { outPath = ./.; rev = "abcdef"; }
# The systems that the jobset will be built for.
, supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
}:
let
defaultNix = import cardano-addresses;
linuxBuild = builtins.elem "x86_64-linux" supportedSystems;
defaultSystem =
if linuxBuild then "x86_64-linux"
else builtins.head supportedSystems;
inherit (defaultNix.legacyPackages.${builtins.currentSystem}) pkgs;
inherit (pkgs) lib;
inherit (defaultNix) packages checks devShell;
in
let
collectJobs = a: lib.filterAttrs (s: _: builtins.elem s supportedSystems) a;
# This file seems pointless, but it forces Hydra to re-evaluate
# every commit. The side-effect of that is that Hydra reports build
# status to GitHub for every commit, which we want, and it wouldn't
# normally do.
build-version = pkgs.writeText "revision.json" (builtins.toJSON
{ inherit (cardano-addresses) rev; });
jobs = lib.genAttrs [ "packages" "checks" "devShell" ] (n: collectJobs defaultNix.${n})
// {
required = pkgs.releaseTools.aggregate {
name = "github-required";
meta.description = "All jobs required to pass CI";
constituents = [ build-version ]
++ (
let ps = jobs.packages.${defaultSystem}; in
[
ps."cardano-addresses-cli:exe:cardano-address"
ps."js-unknown-ghcjs:cardano-addresses:lib:cardano-addresses"
]
)
++ (lib.optionals linuxBuild (
let ps = jobs.packages."x86_64-linux"; in
[
ps."x86_64-w64-mingw32:cardano-addresses-cli:exe:cardano-address"
ps."x86_64-unknown-linux-musl:cardano-addresses-cli:exe:cardano-address"
]
))
++ (lib.attrValues jobs.checks.${defaultSystem})
++ (lib.attrValues jobs.devShell);
};
};
in
jobs