From f4db77a3a6f219d5293da1ac93af34084a14790f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:25:25 +0200 Subject: [PATCH] chore: update makefile release dry runs (#3172) (#3180) * chore: update makefile release dry runs * documentation (cherry picked from commit a72086cc1275a4615f96f577f7ff987acd1a2fa8) Co-authored-by: MSalopek --- Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 56e42f86b89..b9c667f1be9 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,13 @@ distclean: clean ### Release ### ############################################################################### +GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) +GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION) +COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') + # create tag and run goreleaser without publishing +# errors are possible while running goreleaser - the process can run for >30 min +# if the build is failing due to timeouts use goreleaser-build-local instead create-release-dry-run: ifneq ($(strip $(TAG)),) @echo "--> Dry running release for tag: $(TAG)" @@ -159,16 +165,26 @@ ifneq ($(strip $(TAG)),) @git tag -d $(TAG) @echo "--> Running goreleaser" @go install github.com/goreleaser/goreleaser@latest - TM_VERSION=$(TM_VERSION) goreleaser release --snapshot --clean + @docker run \ + --rm \ + -e CGO_ENABLED=1 \ + -e TM_VERSION=$(TM_VERSION) \ + -e COSMWASM_VERSION=$(COSMWASM_VERSION) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v `pwd`:/go/src/gaiad \ + -w /go/src/gaiad \ + $(GORELEASER_IMAGE) \ + release \ + --snapshot \ + --skip=publish \ + --debug \ + --clean @rm -rf dist/ @echo "--> Done create-release-dry-run for tag: $(TAG)" else @echo "--> No tag specified, skipping tag release" endif -GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2) -GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION) -COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') # uses goreleaser to create static binaries for linux an darwin on local machine # platform is set because not setting it results in broken builds for linux-amd64