From f39f3a94386cec0f38b8c56e1ebef877c483dc6a Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sat, 1 Nov 2014 18:21:47 +0100 Subject: [PATCH] Creating a target for tagging components on a release --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 636cd1895ec..a1a17ecf591 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ CURRENT_BRANCH=$(shell git branch | grep '*' | tr -d '* ') # Github settings UPLOAD_HOST=https://uploads.github.com API_HOST=https://api.github.com -OWNER='cakephp' +OWNER="cakephp" REMOTE="origin" ifdef GITHUB_TOKEN @@ -159,6 +159,7 @@ publish: guard-VERSION guard-GITHUB_USER dist/cakephp-$(DASH_VERSION).zip # Tasks for publishing separate reporsitories out of each cake namespace components: $(foreach component, $(COMPONENTS), component-$(component)) +components-tag: $(foreach component, $(COMPONENTS), tag-component-$(component)) component-%: git checkout $(CURRENT_BRANCH) > /dev/null @@ -169,5 +170,14 @@ component-%: git push $* $*:master git checkout $(CURRENT_BRANCH) > /dev/null +tag-component-%: component-% guard-VERSION guard-GITHUB_USER + @echo "Creating tag for the $* component" + git checkout $* + curl $(AUTH) -XPOST $(API_HOST)/repos/$(OWNER)/$*/git/refs -d '{ \ + "refs": "refs\/tags\/$(VERSION)", \ + "sha": "$(shell git rev-parse $*)" \ + }' + git checkout $(CURRENT_BRANCH) > /dev/null + # Top level alias for doing a release. release: guard-VERSION guard-GITHUB_USER tag-release package publish components