Skip to content

Commit

Permalink
Fix goreleaser cross missing image (#8990)
Browse files Browse the repository at this point in the history
* Use major version only to fetch goreleaser image

* Add a way to test the goreleaser releases
  • Loading branch information
pablin-10 authored Feb 10, 2025
1 parent ff4df70 commit d8b55d1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ E2E_UPGRADE_VERSION := "v29"

# Go version to be used in docker images
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
GO_MAJOR_MINOR := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2 | cut -d '.' -f 1-2)
# currently installed Go version
GO_MODULE := $(shell cat go.mod | grep "module " | cut -d ' ' -f 2)
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
Expand Down Expand Up @@ -211,7 +212,7 @@ go-mock-update:
###############################################################################
### Release ###
###############################################################################
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_VERSION)
GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v$(GO_MAJOR_MINOR)
COSMWASM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm/v2 | sed 's/.* //')

ifdef GITHUB_TOKEN
Expand All @@ -231,6 +232,17 @@ release:
@echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'."
endif

release-test:
docker run \
--rm \
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/osmosisd \
-w /go/src/osmosisd \
$(GORELEASER_IMAGE) \
release \
--snapshot --clean

.PHONY: all build-linux install format lint \
go-mod-cache draw-deps clean build build-contract-tests-hooks \
test test-all test-build test-cover test-unit test-race benchmark \
Expand Down

0 comments on commit d8b55d1

Please sign in to comment.