Browse Source

Creating a target for tagging components on a release

Jose Lorenzo Rodriguez 11 years ago
parent
commit
f39f3a9438
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Makefile

+ 11 - 1
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