temporal-cli: fix version, add versionCheckHook (#531022)

This commit is contained in:
Colin
2026-06-19 20:38:02 +00:00
committed by GitHub
+11 -2
View File
@@ -6,6 +6,7 @@
writableTmpDirAsHomeHook,
stdenv,
nix-update-script,
versionCheckHook,
}:
buildGoModule (finalAttrs: {
@@ -21,6 +22,8 @@ buildGoModule (finalAttrs: {
vendorHash = "sha256-N9K05Kcb0YaQO7M9gR22QzAOzbmgEhIqADcAESqYtQ8=";
__structuredAttrs = true;
nativeBuildInputs = [ installShellFiles ];
subPackages = [
@@ -30,7 +33,7 @@ buildGoModule (finalAttrs: {
ldflags = [
"-s"
"-w"
"-X github.com/temporalio/cli/temporalcli.Version=${finalAttrs.version}"
"-X github.com/temporalio/cli/internal/temporalcli.Version=${finalAttrs.version}"
];
# Tests fail with x86 on macOS Rosetta 2
@@ -38,6 +41,9 @@ buildGoModule (finalAttrs: {
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd temporal \
--bash <($out/bin/temporal completion bash) \
@@ -58,7 +64,10 @@ buildGoModule (finalAttrs: {
description = "Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal";
homepage = "https://docs.temporal.io/cli";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aaronjheng ];
maintainers = with lib.maintainers; [
aaronjheng
jlesquembre
];
mainProgram = "temporal";
};
})