-
Notifications
You must be signed in to change notification settings - Fork 2
/
release.nix
83 lines (68 loc) · 1.62 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
let
pkgs = import <nixpkgs> {};
in {
commit = { commit }: pkgs.stdenv.mkDerivation {
name = "computation";
src = ./.;
buildInputs = [
pkgs.nodejs-14_x
pkgs.jq
];
buildPhase = ''
HOME=$PWD npm ci
./node_modules/.bin/tsc
cat package.json | jq 'del(.devDependencies) | .version = "0.0.0-g${commit}"' > dist/package.json
'';
checkPhase = ''
./node_modules/.bin/tslint --project .
./node_modules/.bin/mocha dist
'';
installPhase = ''
mv dist $out
rm $out/*.test.*
'';
};
canary = { n, commit }: pkgs.stdenv.mkDerivation {
name = "computation";
src = ./.;
buildInputs = [
pkgs.nodejs-14_x
pkgs.jq
];
buildPhase = ''
HOME=$PWD npm ci
./node_modules/.bin/tsc
npm --no-git-tag-version version patch
cat package.json | jq 'del(.devDependencies) | .version = .version + "-alpha.${n}+${commit}"' > dist/package.json
'';
checkPhase = ''
./node_modules/.bin/tslint --project .
./node_modules/.bin/mocha dist
'';
installPhase = ''
mv dist $out
rm $out/*.test.*
'';
};
head = pkgs.stdenv.mkDerivation {
name = "computation";
src = ./.;
buildInputs = [
pkgs.nodejs-14_x
pkgs.jq
];
buildPhase = ''
HOME=$PWD npm ci
./node_modules/.bin/tsc
cat package.json | jq 'del(.devDependencies)' > dist/package.json
'';
checkPhase = ''
./node_modules/.bin/tslint --project .
./node_modules/.bin/mocha dist
'';
installPhase = ''
mv dist $out
rm $out/*.test.*
'';
};
}