From d9ddf4ee99d4e3f5830db6c0fbaea2a391eba76a Mon Sep 17 00:00:00 2001 From: 2xburnt <169301814+2xburnt@users.noreply.github.com> Date: Wed, 23 Oct 2024 08:37:26 -0500 Subject: [PATCH 1/2] fix missing version/commit in binary --- .github/workflows/docker-build.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index aa005089..e181fe48 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -71,6 +71,8 @@ jobs: platforms: ${{ matrix.os }}/${{ matrix.arch }} tags: xion:${{ matrix.os }}-${{ matrix.arch }} build-args: | + COMMIT=${{ github.sha }} + VERSION=${{ github.ref_name }} XIOND_BINARY=dist/xiond_${{ matrix.os }}_${{ matrix.arch }}/xiond - name: Build Heighliner Image @@ -84,6 +86,8 @@ jobs: platforms: ${{ matrix.os }}/${{ matrix.arch }} tags: heighliner:${{ matrix.os }}-${{ matrix.arch }} build-args: | + COMMIT=${{ github.sha }} + VERSION=${{ github.ref_name }} XIOND_BINARY=dist/xiond_${{ matrix.os }}_${{ matrix.arch }}/xiond - name: Save Docker Image From 824f5e54070598097033a767b5bc57c2bfe0dcb1 Mon Sep 17 00:00:00 2001 From: 2xburnt <169301814+2xburnt@users.noreply.github.com> Date: Wed, 23 Oct 2024 09:08:40 -0500 Subject: [PATCH 2/2] guard against missing vars --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c9581a83..10f30eb2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ PACKAGES_SIMTEST = $(shell go list ./... | grep '/simulation') VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//') COMMIT ?= $(shell git log -1 --format='%H') -TAG_VERSION ?= $(shell git rev-parse --short HEAD) LEDGER_ENABLED ?= true SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') BINDIR ?= $(GOPATH)/bin @@ -86,7 +85,7 @@ all: install lint test install: go.sum go install -mod=readonly $(BUILD_FLAGS) ./cmd/xiond -build: go.sum +build: guard-VERSION guard-COMMIT ifeq ($(OS),Windows_NT) $(error wasmd server not supported. Use "make build-windows-client" for client) exit 1 @@ -231,6 +230,12 @@ clean: distclean: clean rm -rf vendor/ +guard-%: + @ if [ "${${*}}" = "" ]; then \ + echo "Environment variable $* not set"; \ + exit 1; \ + fi + ############################################################################### ### Testing ### ###############################################################################