From da35c88f91df0799935cce79e8e6baaf7e8e0222 Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Fri, 25 Jul 2025 11:16:25 -0300 Subject: [PATCH 1/2] chore: added a Makefile action to assist in the tag process for subfolders --- Makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Makefile b/Makefile index 181de584d26e..7cc6f35902e2 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git DOCKER := $(shell which docker) PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) +# Subdirectories for tagging +SUBDIR_PREFIXES := api core errors store x/circuit x/evidence x/feegrant x/nft x/tx x/upgrade + # process build tags build_tags = netgo ifeq ($(LEDGER_ENABLED),true) @@ -481,3 +484,30 @@ localnet-start: localnet-stop localnet-build-env localnet-build-nodes localnet-debug: localnet-stop localnet-build-dlv localnet-build-nodes .PHONY: localnet-start localnet-stop localnet-debug localnet-build-env localnet-build-dlv localnet-build-nodes + +############################################################################### +### Tagging ### +############################################################################### + +# tag-subdirs creates and pushes tags with subdir prefixes for a given tag +# Usage: make tag-subdirs TAG=v1.2.3 +# NOTE: the tag for the "client" subdir requires a different version number (it has to start with 2) +# It has to be created manually +tag-subdirs: +ifndef TAG + $(error TAG is required. Usage: make tag-subdirs TAG=v1.2.3) +endif + @echo "Checking out tag $(TAG) from origin..." + @git fetch origin + @git checkout $(TAG) + @echo "Creating and pushing subdir tags for $(TAG)..." + @for prefix in $(SUBDIR_PREFIXES); do \ + new_tag="$$prefix/$(TAG)"; \ + echo "Creating tag: $$new_tag"; \ + git tag "$$new_tag" $(TAG); \ + echo "Pushing tag: $$new_tag"; \ + git push origin "$$new_tag"; \ + done + @echo "Successfully created and pushed all subdir tags for $(TAG)" + +.PHONY: tag-subdirs From 1a2d5bf8b11f28c103879edb2ff0c08f7243e4c6 Mon Sep 17 00:00:00 2001 From: Abel Armoa <30988000+aarmoa@users.noreply.github.com> Date: Fri, 25 Jul 2025 14:17:03 -0300 Subject: [PATCH 2/2] [CHORE] Added a Makefile action to generate the correct tag for the `client` subdir --- Makefile | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 7cc6f35902e2..7a81e0aefdf8 100644 --- a/Makefile +++ b/Makefile @@ -489,17 +489,31 @@ localnet-debug: localnet-stop localnet-build-dlv localnet-build-nodes ### Tagging ### ############################################################################### +# tag-client creates and pushes the special client tag with v2.0.0- prefix +# Usage: make tag-client TAG=v1.2.3 (creates client/v2.0.0-v1.2.3) +tag-client: +ifndef TAG + $(error TAG is required. Usage: make tag-client TAG=v1.2.3) +endif + @echo "Fetching latest tags from origin..." + @git fetch origin --tags + @echo "Creating client tag for $(TAG)..." + @client_tag="client/v2.0.0-$(TAG)"; \ + echo "Creating tag: $$client_tag"; \ + git tag "$$client_tag" $(TAG); \ + echo "Pushing tag: $$client_tag"; \ + git push origin "$$client_tag" + @echo "Successfully created and pushed client tag for $(TAG)" + # tag-subdirs creates and pushes tags with subdir prefixes for a given tag # Usage: make tag-subdirs TAG=v1.2.3 -# NOTE: the tag for the "client" subdir requires a different version number (it has to start with 2) -# It has to be created manually -tag-subdirs: +# NOTE: This also automatically creates the special client tag +tag-subdirs: tag-client ifndef TAG $(error TAG is required. Usage: make tag-subdirs TAG=v1.2.3) endif - @echo "Checking out tag $(TAG) from origin..." - @git fetch origin - @git checkout $(TAG) + @echo "Fetching latest tags from origin..." + @git fetch origin --tags @echo "Creating and pushing subdir tags for $(TAG)..." @for prefix in $(SUBDIR_PREFIXES); do \ new_tag="$$prefix/$(TAG)"; \ @@ -510,4 +524,4 @@ endif done @echo "Successfully created and pushed all subdir tags for $(TAG)" -.PHONY: tag-subdirs +.PHONY: tag-subdirs tag-client