From c19371c7983a40e41dd9d5577d6ca43a0f40493f Mon Sep 17 00:00:00 2001 From: Jacob LeGrone Date: Tue, 9 Aug 2022 14:42:16 -0400 Subject: [PATCH] Update goreleaser config and stamp binaries with semantic version (#104) --- .gitignore | 2 ++ .goreleaser.yaml | 26 ++++++++++++++++++++++++++ cmd/temporalite/main.go | 12 +++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.gitignore b/.gitignore index 32e704f7..f8f19c50 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ # sqlite databases *.db + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..626459d9 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,26 @@ +# Read config documentation at https://goreleaser.com +before: + hooks: + - go mod tidy + - go test ./... +builds: + - main: ./cmd/temporalite + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/cmd/temporalite/main.go b/cmd/temporalite/main.go index 4fa2a6ab..12084f0d 100644 --- a/cmd/temporalite/main.go +++ b/cmd/temporalite/main.go @@ -59,11 +59,17 @@ func main() { } } +// These variables are set by GoReleaser using ldflags +var version string + func buildCLI() *cli.App { + if version == "" { + version = "(devel)" + } app := cli.NewApp() - app.Name = "temporal" - app.Usage = "Temporal server" - app.Version = headers.ServerVersion + app.Name = "temporalite" + app.Usage = "An experimental distribution of Temporal that runs as a single process\n\nFind more information at: https://github.com/temporalio/temporalite" + app.Version = fmt.Sprintf("%s (server %s)", version, headers.ServerVersion) app.Commands = []*cli.Command{ { Name: "start",