variable "version" {
type = string
}
computed "current_os" {
expression = os()
}
computed "current_arch" {
expression = arch()
}
computed "binary_name" {
description = "Platform-specific binary filename"
expression = "app-${var.version}-${computed.current_os}-${computed.current_arch}"
}
task "build" {
description = "Build the release binary for the current platform"
commands = [
"go build -o dist/${computed.binary_name} ./cmd/app",
"echo 'Built: dist/${computed.binary_name}'",
]
}
task "checksum" {
description = "Generate a checksum file for the binary"
depends_on = [task.build]
commands = [
"sha256sum dist/${computed.binary_name} > dist/${computed.binary_name}.sha256",
]
}