Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Creating a target for tagging components on a release
  • Loading branch information
lorenzo committed Nov 1, 2014
1 parent cedb85c commit f39f3a9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit f39f3a9

Please sign in to comment.