Skip to content

Commit

Permalink
Adding task to cut a release tag and push it.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 8, 2012
1 parent 6361500 commit ce80a78
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions build.properties
@@ -1,6 +1,10 @@
# Name
project.name = CakePHP

# Git stuff
git.remote =

# Directories
build.dir = build
dist.dir = dist

31 changes: 26 additions & 5 deletions build.xml
Expand Up @@ -92,6 +92,8 @@
<channel>pear.php.net</channel>
<description>CakePHP </description>
<lead user="mark_story" name="Mark Story" email="mark@mark-story.com" />
<lead user="lorenzo" name="José Lorenzo Rodríguez" email="jose.zap@gmail.com" />
<lead user="PhpNut" name="Larry Masters" email="phpnut@cakephp.org" />
<license>MIT License</license>
<version release="${pear.version}" api="${pear.version}" />
<stability release="${pear.stability}" api="${pear.stability}" />
Expand All @@ -117,24 +119,43 @@
<move file="${build.dir}/${project.name}-${version}/${project.name}-${pear.version}.tgz" todir="${dist.dir}" />
</target>

<!-- top level easy to type target -->
<target name="build" depends="generate-package" />


<!--
Bump the version number and commit that.
-->
<target name="next-version" depends="prepare">
<echo msg="Incrementing version." />
<propertyprompt propertyName="release_version" defaultValue="${version}" promptText="Enter version to be released (without -DEV)"/>
<echo msg="New version will be ${release_version}" />
<echo msg="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
<exec executable="php">
<arg value="-r" />
<arg value="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
</exec>
<echo msg="Version number updated." />
</target>

<target name="release-commit" depends="prepare,next-version">
<echo msg="Creating new release commit" />
<exec command="git add ./lib/Cake/VERSION.txt" />
<exec command="git commit -m 'Update version number to ${release_version}'" />
<exec command="git tag -a ${release_version} -m 'CakePHP ${release_version}'" />

<propertyprompt propertyName="shipit" defaultValue="n" promptText="Ship the new commit and tag?" />
<condition property="noshipit" value="1">
<not>
<equals arg1="y" arg2="${shipit}" casesensitive="false" />
</not>
</condition>
<fail if="noshipit" msg="You said not to ship it." />

<exec command="git push ${git.remote}" />
<exec command="git push --tags ${git.remote}" />
<echo msg="Pushed commit and tag." />
</target>


<!-- top level easy to type targets -->
<target name="build" depends="generate-package" />
<target name="release" depends="release-commit,build" />


</project>

0 comments on commit ce80a78

Please sign in to comment.