don't use SHA1s as status-go version
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
5fe385c225
commit
05ee65b6fa
|
@ -31,10 +31,11 @@ def gitCommit() {
|
||||||
return GIT_COMMIT.take(6)
|
return GIT_COMMIT.take(6)
|
||||||
}
|
}
|
||||||
|
|
||||||
def pkgFilename(type, ext, arch="universal") {
|
def pkgFilename(type, ext, arch=null) {
|
||||||
|
/* the grep removes the null arch */
|
||||||
return [
|
return [
|
||||||
"StatusIm", timestamp(), gitCommit(), type, arch,
|
"StatusIm", timestamp(), gitCommit(), type, arch,
|
||||||
].join('-') + ".${ext}"
|
].grep().join('-') + ".${ext}"
|
||||||
}
|
}
|
||||||
|
|
||||||
def doGitRebase() {
|
def doGitRebase() {
|
||||||
|
|
|
@ -12,8 +12,8 @@ let
|
||||||
gomobile = callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit target-os xcodeWrapper utils buildGoPackage; };
|
gomobile = callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit target-os xcodeWrapper utils buildGoPackage; };
|
||||||
buildStatusGoDesktopLib = callPackage ./build-desktop-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
buildStatusGoDesktopLib = callPackage ./build-desktop-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
||||||
buildStatusGoMobileLib = callPackage ./build-mobile-status-go.nix { inherit buildGoPackage go gomobile xcodeWrapper utils; };
|
buildStatusGoMobileLib = callPackage ./build-mobile-status-go.nix { inherit buildGoPackage go gomobile xcodeWrapper utils; };
|
||||||
extractStatusGoConfig = callPackage ./extract-status-go-config.nix { inherit (stdenv) lib; };
|
|
||||||
versionJSON = importJSON ../../status-go-version.json; # TODO: Simplify this path search with lib.locateDominatingFile
|
versionJSON = importJSON ../../status-go-version.json; # TODO: Simplify this path search with lib.locateDominatingFile
|
||||||
|
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:].]+)$";
|
||||||
owner = versionJSON.owner;
|
owner = versionJSON.owner;
|
||||||
repo = versionJSON.repo;
|
repo = versionJSON.repo;
|
||||||
version = versionJSON.version;
|
version = versionJSON.version;
|
||||||
|
@ -58,8 +58,10 @@ let
|
||||||
goBuildFlags = "-v";
|
goBuildFlags = "-v";
|
||||||
# status-go params to be set at build time, important for About section and metrics
|
# status-go params to be set at build time, important for About section and metrics
|
||||||
goBuildParams = {
|
goBuildParams = {
|
||||||
Version = removePrefix "v" version; # Geth forces a 'v' prefix
|
|
||||||
GitCommit = rev;
|
GitCommit = rev;
|
||||||
|
Version = if (builtins.match versionRegex version) != null
|
||||||
|
then removePrefix "v" version # Geth forces a 'v' prefix
|
||||||
|
else "develop"; # to reduce metrics cardinality in Prometheus
|
||||||
};
|
};
|
||||||
# These are necessary for status-go to show correct version
|
# These are necessary for status-go to show correct version
|
||||||
paramsLdFlags = attrValues (mapAttrs (name: value:
|
paramsLdFlags = attrValues (mapAttrs (name: value:
|
||||||
|
|
|
@ -37,7 +37,9 @@ STATUS_GO_COMMIT_SHA1=$(git ls-remote ${repoUrl} U ${STATUS_GO_VERSION} | cut -f
|
||||||
|
|
||||||
if [[ -z "${STATUS_GO_COMMIT_SHA1}" ]]; then
|
if [[ -z "${STATUS_GO_COMMIT_SHA1}" ]]; then
|
||||||
echo "Could not find SHA1 for rev ${STATUS_GO_VERSION}, assuming it's a commit."
|
echo "Could not find SHA1 for rev ${STATUS_GO_VERSION}, assuming it's a commit."
|
||||||
|
echo "WARNING: Setting 'version' value to 'develop'"
|
||||||
STATUS_GO_COMMIT_SHA1="${STATUS_GO_VERSION}"
|
STATUS_GO_COMMIT_SHA1="${STATUS_GO_VERSION}"
|
||||||
|
STATUS_GO_VERSION="develop" # to reduce metrics cardinality in Prometheus
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STATUS_GO_SHA256=$(nix-prefetch-url --unpack ${repoUrl}/archive/${STATUS_GO_VERSION}.zip)
|
STATUS_GO_SHA256=$(nix-prefetch-url --unpack ${repoUrl}/archive/${STATUS_GO_VERSION}.zip)
|
||||||
|
|
Loading…
Reference in New Issue