fix(radar): inject correct build version via ldflags
Some checks failed
CI / check (pull_request) Has been cancelled
Some checks failed
CI / check (pull_request) Has been cancelled
Version was showing as "dev" instead of "v1.5.14" because ldflags targeted the wrong variable. Changed from internal/version.Current to main.version which is the variable actually used by cmd/explorer.
This commit is contained in:
@@ -6,13 +6,13 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "1.5.10";
|
version = "1.5.14";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "skyhook-io";
|
owner = "skyhook-io";
|
||||||
repo = "radar";
|
repo = "radar";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
hash = "sha256-Xvn1dDqCaBlXY/XD2GoWBDECMhxFlYCGlnVinLR/c1A=";
|
hash = "sha256-/TebJGe672kefEci2WuDWw31ivGiMImxQCcWIzJ8pQE=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Build the frontend as a separate derivation.
|
# Build the frontend as a separate derivation.
|
||||||
@@ -75,7 +75,7 @@ buildGoModule {
|
|||||||
pname = "radar";
|
pname = "radar";
|
||||||
inherit version src;
|
inherit version src;
|
||||||
|
|
||||||
vendorHash = "sha256-bmS4nRzVG4ZmpV3kq2Ih8uerRWL5weq0KP54jT3sh5I=";
|
vendorHash = "sha256-86+KD+MTiBh+Nw64suCWCkv90/+FXUKWiv1CS2EWTpw=";
|
||||||
|
|
||||||
# Copy pre-built frontend assets before Go compilation for go:embed
|
# Copy pre-built frontend assets before Go compilation for go:embed
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
@@ -85,6 +85,12 @@ buildGoModule {
|
|||||||
|
|
||||||
env.CGO_ENABLED = 0;
|
env.CGO_ENABLED = 0;
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X main.version=v${version}"
|
||||||
|
];
|
||||||
|
|
||||||
subPackages = [ "cmd/explorer" ];
|
subPackages = [ "cmd/explorer" ];
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user