-
Notifications
You must be signed in to change notification settings - Fork 100
/
release.nix
92 lines (86 loc) · 2.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{ nixpkgs ? <nixpkgs>
, systems ? [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]
}:
let
pkgs = import nixpkgs {};
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
jobset = import ./default.nix {
inherit pkgs;
system = builtins.currentSystem;
};
in
rec {
inherit (jobset) tarball;
package = pkgs.lib.genAttrs systems (system:
(import ./default.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package.override {
postInstall = ''
mkdir -p $out/share/doc/node2nix
$out/lib/node_modules/node2nix/node_modules/jsdoc/jsdoc.js -R README.md -r lib -d $out/share/doc/node2nix/apidox
mkdir -p $out/nix-support
echo "doc api $out/share/doc/node2nix/apidox" >> $out/nix-support/hydra-build-products
'';
}
);
tests = pkgs.lib.genAttrs systems (system:
{
v14 = import ./tests/override-v14.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
v16 = import ./tests/override-v16.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
grunt = import ./tests/grunt/override.nix {
pkgs = import nixpkgs { inherit system; };
inherit system;
};
lockfile = (import ./tests/lockfile {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package;
lockfile-v2 = (import ./tests/lockfile-v2 {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package;
scoped = (import ./tests/scoped {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package;
versionless = (import ./tests/versionless {
pkgs = import nixpkgs { inherit system; };
inherit system;
}).package;
}) // {
cli = import ./tests/cli {
inherit nixpkgs;
node2nix = builtins.getAttr (builtins.currentSystem) package;
};
};
release = pkgs.releaseTools.aggregate {
name = "node2nix-${version}";
constituents = [
tarball
]
++ map (system: builtins.getAttr system package) systems
++ pkgs.lib.flatten (map (system:
let
tests_ = tests."${system}".v14;
in
map (name: builtins.getAttr name tests_) (builtins.attrNames tests_)
) systems)
++ pkgs.lib.flatten (map (system:
let
tests_ = tests."${system}".v16;
in
map (name: builtins.getAttr name tests_) (builtins.attrNames tests_)
) systems)
++ map (system: tests."${system}".grunt) systems
++ map (system: tests."${system}".lockfile) systems
++ map (system: tests."${system}".scoped) systems
++ [ tests.cli ];
};
}