diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef105c3..371eea4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,13 @@ jobs: echo "tag=$TAG" echo "tag=$TAG" >> $GITHUB_OUTPUT + - name: Build binary with version info + env: + VERSION: ${{ steps.get_tag.outputs.tag }} + run: | + mkdir -p bin + go build -ldflags "-X github.com/apiqube/cli/cmd.version=$VERSION" -o ./bin/qube . + - name: Create GitHub Release (if not exists) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 27b98cb..94d639f 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ BUILD_DIR=./bin .PHONY: build clean +install: + go install github.com/apiqube/cli@latest + build: @echo "🔧 Building $(BINARY_NAME) version $(VERSION)" go build \ diff --git a/go.mod b/go.mod index c830ff8..c8c9ff0 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/apiqube/cli -go 1.24.2 +go 1.24.3 require github.com/spf13/cobra v1.9.1 require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/spf13/pflag v1.0.6 // indirect -) +) \ No newline at end of file