diff --git a/Makefile b/Makefile index f284e3f9..0778d9c1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ COMMIT := $(shell git log -1 --format='%H') +GO_VERSION := $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1 -f2) VERSION := v1.2.1 # $(shell echo $(shell git describe --tags) | sed 's/^v//') TEAM_ALLOCATION := 165000000000000 @@ -14,8 +15,6 @@ DENOM := ukyve TEAM_TGE := 2023-03-14T14:03:14 TEAM_FOUNDATION_ADDRESS := kyve1xjpl57p7f49y5gueu7rlfytaw9ramcn5zhjy2g TEAM_BCP_ADDRESS := kyve1fnh4kghr25tppskap50zk5j385pt65tyyjaraa -else -$(error ❌ Please specify a build environment..) endif ldflags := $(LDFLAGS) @@ -34,23 +33,23 @@ BUILD_FLAGS := -ldflags '$(ldflags)' -tags 'ledger' -trimpath .PHONY: proto-setup proto-format proto-lint proto-gen \ format lint vet test build release dev -all: proto-all format lint test build +all: ensure_environment ensure_version proto-all format lint test build ############################################################################### ### Build ### ############################################################################### -build: +build: ensure_environment ensure_version @echo "🤖 Building kyved..." @go build $(BUILD_FLAGS) -o "$(PWD)/build/" ./cmd/kyved @echo "✅ Completed build!" -install: +install: ensure_environment ensure_version @echo "🤖 Installing kyved..." @go install -mod=readonly $(BUILD_FLAGS) ./cmd/kyved @echo "✅ Completed installation!" -release: +release: ensure_environment ensure_version @echo "🤖 Creating kyved releases..." @rm -rf release @mkdir -p release @@ -74,6 +73,20 @@ release: @rm kyved @echo "✅ Completed release creation!" +############################################################################### +### Checks ### +############################################################################### + +ensure_environment: +ifndef ENV + $(error ❌ Please specify a build environment..) +endif + +ensure_version: +ifneq ($(GO_VERSION),1.20) + $(error ❌ Please run Go v1.20.x..) +endif + ############################################################################### ### Development ### ############################################################################### @@ -109,13 +122,13 @@ vet: ### Protobuf ### ############################################################################### -BUF_VERSION=1.17.0 +BUF_VERSION=1.20.0 proto-all: proto-format proto-lint proto-gen proto-format: @echo "🤖 Running protobuf formatter..." - @docker run --volume "$(PWD)":/workspace --workdir /workspace \ + @docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ bufbuild/buf:$(BUF_VERSION) format --diff --write @echo "✅ Completed protobuf formatting!" @@ -127,7 +140,7 @@ proto-gen: proto-lint: @echo "🤖 Running protobuf linter..." - @docker run --volume "$(PWD)":/workspace --workdir /workspace \ + @docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ bufbuild/buf:$(BUF_VERSION) lint @echo "✅ Completed protobuf linting!" diff --git a/proto/buf.lock b/proto/buf.lock index ecb58968..f4282d8a 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -5,15 +5,19 @@ deps: owner: cosmos repository: cosmos-proto commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 - remote: buf.build owner: cosmos repository: cosmos-sdk commit: 8cb30a2c4de74dc9bd8d260b1e75e176 + digest: shake256:fc1fa1650a3fa2177b95f2f47d3b6b3673a1d42bfecf7407cc5f9cad176e1ba27877a73f1448a66a38b00292ce70b42171ff9632211014f34f13fb32f6f5e76f - remote: buf.build owner: cosmos repository: gogo-proto - commit: 34d970b699f84aa382f3c29773a60836 + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 - remote: buf.build owner: googleapis repository: googleapis - commit: 783e4b5374fa488ab068d08af9658438 + commit: cc916c31859748a68fd229a3c8d7a2e8 + digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8 diff --git a/proto/buf.yaml b/proto/buf.yaml index 24561cc0..279619d2 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,6 +1,7 @@ version: v1 name: buf.build/kyve/chain deps: + - buf.build/cosmos/cosmos-proto # Cosmos SDK v0.46 (https://github.com/cosmos/cosmos-sdk/tree/main/proto#sdk-x-buf) - buf.build/cosmos/cosmos-sdk:8cb30a2c4de74dc9bd8d260b1e75e176 - buf.build/cosmos/gogo-proto