Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
-include .env
export

# Derive the version from git so `make build` stamps the binary. Falls back to
# the commit hash if no tag is reachable, and appends "-dirty" for uncommitted changes.
# When git is unavailable (e.g. a source tarball), VERSION is empty and we omit the
# ldflag entirely so the in-code default (0.0.0-DEV) is preserved.
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null)
VERSION_PKG := github.com/temporalio/cloud-cli/temporalcloudcli
LDFLAGS := $(if $(VERSION),-X $(VERSION_PKG).Version=$(VERSION))

all: gen build mocks test

# we need to install gen-commands directly because gen-commands does not have its
Expand All @@ -18,7 +26,7 @@ gen: install
gen-commands -input ./temporalcloudcli/commands.yml -pkg temporalcloudcli > ./temporalcloudcli/commands.gen.go

build:
go build ./cmd/temporal-cloud
go build -ldflags "$(LDFLAGS)" ./cmd/temporal-cloud

test-integration:
go test -tags=integration ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Plugin for the Temporal command-line interface to work with [Temporal Cloud](htt

1. Install [Go](https://go.dev/doc/install) (check [go.mod](./go.mod) for the version).
2. Clone this repository.
3. From the cloned directory, run `make build` (or `go build ./cmd/temporal-cloud`).
3. From the cloned directory, run `make build`.

The executable will be at `temporal-cloud` (`temporal-cloud.exe` for Windows). Add it to your `PATH` so the `temporal` CLI can discover it.

Expand Down
Loading