Skip to content

Commit

Permalink
Fix/no_version (#279)
Browse files Browse the repository at this point in the history
Protect against missing COMMIT or VERSION in makefile

---------

Co-authored-by: Ash <[email protected]>
  • Loading branch information
2xburnt and ash-burnt authored Oct 30, 2024
1 parent 99ce021 commit 26fc7bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -231,6 +230,12 @@ clean:
distclean: clean
rm -rf vendor/

guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi

###############################################################################
### Testing ###
###############################################################################
Expand Down

0 comments on commit 26fc7bf

Please sign in to comment.