-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a jobset for doing SDK releases (#164)
ci/release.nix is called by the sdk-release jobset on hydra. It calls release-jobset.nix which returns the dfx-release and install-sh-release derivations but only when the git revision has been tagged with a release tag (v0.1.2). In that case the version in those derivations is set to the version in the tag ensuring that they get rebuild.
- Loading branch information
1 parent
da99215
commit 8ad3376
Showing
5 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ] | ||
, scrubJobs ? true | ||
, src ? null | ||
}: | ||
(import ../nix {}).ci ../release-jobset.nix { inherit supportedSystems scrubJobs src; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
, crossSystem ? null | ||
, config ? {} | ||
, overlays ? [] | ||
, releaseVersion ? "latest" | ||
}: | ||
let | ||
# The `common` repo provides code (mostly Nix) that is used in the | ||
|
@@ -20,9 +21,9 @@ let | |
else builtins.fetchGit { | ||
name = "common-sources"; | ||
url = "ssh://[email protected]/dfinity-lab/common"; | ||
rev = "d5af3fda55af07de25f06fc46a2bf5f83424f02b"; | ||
rev = "bbf39c31e08b4ab7db82f799a3e3c693a0fdced6"; | ||
}; | ||
in import commonSrc { | ||
inherit system crossSystem config; | ||
overlays = import ./overlays ++ overlays; | ||
overlays = import ./overlays ++ [ (_self: _super: { inherit releaseVersion; }) ] ++ overlays; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ system ? builtins.currentSystem | ||
, crossSystem ? null | ||
, config ? {} | ||
, overlays ? [] | ||
|
||
# Hydra will pass an argument to this jobset expression for every | ||
# input of the jobset. In our case we only have a single `src` input | ||
# representing the git checkout of the SDK repo: | ||
# | ||
# https://hydra.dfinity.systems/jobset/dfinity-ci-build/sdk#tabs-configuration | ||
# | ||
# This `src` argument contains information about the input for example: | ||
# | ||
# { outPath = builtins.storePath /nix/store/ma2dfyfyxdi6idbza6dyp34zhxh12nmm-source; | ||
# inputType = "git"; | ||
# uri = "[email protected]:dfinity-lab/sdk.git"; | ||
# rev = "8882d8c97decbb3c33923ca9e8ab785621a61207"; | ||
# revCount = 2514; | ||
# gitTag = "8882d8c9"; # This defaults to the rev when there's no git tag. | ||
# shortRev = "8882d8c9"; | ||
# } | ||
# | ||
# See: https://github.com/NixOS/hydra/blob/037f6488f633dbf15ca2d93a0c117f6738c707fe/src/lib/Hydra/Plugin/GitInput.pm#L241:L248 | ||
# | ||
# We're primarily interested in the `src.gitTag` since that should trigger a release. | ||
, src ? null | ||
}: | ||
let | ||
# doRelease is true when the git tag is of the right release format like `0.1.2`. | ||
doRelease = src != null && versionMatches != null; | ||
|
||
# versionMatch is `null` if `src.gitTag` is not of the right format like "1.23.456" | ||
# and it's a list of matches like [ "1.23.456" ] when it is. | ||
versionMatches = builtins.match "([0-9]+\.[0-9]+\.[0-9]+)" src.gitTag; | ||
releaseVersion = if versionMatches == null then "latest" else builtins.head versionMatches; | ||
|
||
pkgs = import ./nix { inherit system config overlays releaseVersion; }; | ||
|
||
in pkgs.lib.optionalAttrs doRelease { | ||
inherit (pkgs.dfinity-sdk) dfx-release install-sh-release; | ||
} |