Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update makefile release dry runs (backport #3172) #3180

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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
Expand Down