File tree Expand file tree Collapse file tree 5 files changed +52
-8
lines changed
Expand file tree Collapse file tree 5 files changed +52
-8
lines changed Original file line number Diff line number Diff line change 1+ { supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ]
2+ , scrubJobs ? true
3+ , src ? null
4+ } :
5+ ( import ../nix { } ) . ci ../release-jobset.nix { inherit supportedSystems scrubJobs src ; }
Original file line number Diff line number Diff line change 22, crossSystem ? null
33, config ? { }
44, overlays ? [ ]
5+ , src ? null
56} : {
67 inherit ( import ./nix { inherit system crossSystem config overlays ; } ) dfinity-sdk ;
78}
Original file line number Diff line number Diff line change 44, crossSystem ? null
55, config ? { }
66, overlays ? [ ]
7+ , releaseVersion ? "latest"
78} :
89let
910 # The `common` repo provides code (mostly Nix) that is used in the
2021 else builtins . fetchGit {
2122 name = "common-sources" ;
2223 url = "ssh://[email protected] /dfinity-lab/common" ; 23- rev = "d5af3fda55af07de25f06fc46a2bf5f83424f02b " ;
24+ rev = "bbf39c31e08b4ab7db82f799a3e3c693a0fdced6 " ;
2425 } ;
2526in import commonSrc {
2627 inherit system crossSystem config ;
27- overlays = import ./overlays ++ overlays ;
28+ overlays = import ./overlays ++ [ ( _self : _super : { inherit releaseVersion ; } ) ] ++ overlays ;
2829 }
Original file line number Diff line number Diff line change 2929 public-folder = super . callPackage ../public.nix { } ;
3030 } ;
3131
32- dfx-release = mkRelease "dfx"
33- # This is not the tagged version, but something afterwards
34- "latest" # once INF-495 is in, we will use: packages.rust-workspace.version
35- packages . rust-workspace-standalone
36- "dfx" ;
32+ dfx-release = mkRelease "dfx" self . releaseVersion packages . rust-workspace-standalone "dfx" ;
3733
3834 # The following prepares a manifest for copying install.sh
3935 # The release part also checks if the install.sh script is well formatted and has no shellcheck issues.
4036 # We ignore 'local' warning by shellcheck, because any existing sh implementation supports it.
4137 # TODO: streamline mkRelease and this
4238 install-sh-release =
4339 let
44- version = "latest" ;
40+ version = self . releaseVersion ;
4541 shfmtOpts = "-p -i 4 -ci -bn -s" ;
4642 shellcheckOpts = "-s sh -S warning" ;
4743 # We want to include the last revision of the install script into
Original file line number Diff line number Diff line change 1+ { system ? builtins . currentSystem
2+ , crossSystem ? null
3+ , config ? { }
4+ , overlays ? [ ]
5+
6+ # Hydra will pass an argument to this jobset expression for every
7+ # input of the jobset. In our case we only have a single `src` input
8+ # representing the git checkout of the SDK repo:
9+ #
10+ # https://hydra.dfinity.systems/jobset/dfinity-ci-build/sdk#tabs-configuration
11+ #
12+ # This `src` argument contains information about the input for example:
13+ #
14+ # { outPath = builtins.storePath /nix/store/ma2dfyfyxdi6idbza6dyp34zhxh12nmm-source;
15+ # inputType = "git";
16+ # uri = "[email protected] :dfinity-lab/sdk.git"; 17+ # rev = "8882d8c97decbb3c33923ca9e8ab785621a61207";
18+ # revCount = 2514;
19+ # gitTag = "8882d8c9"; # This defaults to the rev when there's no git tag.
20+ # shortRev = "8882d8c9";
21+ # }
22+ #
23+ # See: https://github.com/NixOS/hydra/blob/037f6488f633dbf15ca2d93a0c117f6738c707fe/src/lib/Hydra/Plugin/GitInput.pm#L241:L248
24+ #
25+ # We're primarily interested in the `src.gitTag` since that should trigger a release.
26+ , src ? null
27+ } :
28+ let
29+ # doRelease is true when the git tag is of the right release format like `0.1.2`.
30+ doRelease = src != null && versionMatches != null ;
31+
32+ # versionMatch is `null` if `src.gitTag` is not of the right format like "1.23.456"
33+ # and it's a list of matches like [ "1.23.456" ] when it is.
34+ versionMatches = builtins . match "([0-9]+\. [0-9]+\. [0-9]+)" src . gitTag ;
35+ releaseVersion = if versionMatches == null then "latest" else builtins . head versionMatches ;
36+
37+ pkgs = import ./nix { inherit system config overlays releaseVersion ; } ;
38+
39+ in pkgs . lib . optionalAttrs doRelease {
40+ inherit ( pkgs . dfinity-sdk ) dfx-release install-sh-release ;
41+ }
You can’t perform that action at this time.
0 commit comments