]> source.dussan.org Git - gitblit.git/commitdiff
Add project property `release.tag` as a global `project.tag`
authorFlorian Zschocke <florian.zschocke@devolo.de>
Mon, 27 Jan 2020 19:30:44 +0000 (20:30 +0100)
committerFlorian Zschocke <florian.zschocke@devolo.de>
Mon, 27 Jan 2020 20:48:20 +0000 (21:48 +0100)
Add property `release.tag` to keep a generally available property.
The `project.tag` was getting used in many places, so I need a global
definition for it. The property `project.tag`, defined in the target
`tagRelease` could not be reused, since when that target runs, the
version is still a SNAPSHOT version. (And properties don't get
re-assigned.) So instead a new property `release.tag` is defined,
just like `release.name`, which can be only used sensible in a
release stage, i.e. after `tagRelease` ran.

build.xml

index 67e365ee5d96415ec6e8d392f939367ac215941a..26c5724a796602e50cc147df28d74703bb632569 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -46,6 +46,7 @@
                <mx:init verbose="no" mxroot="${moxie.dir}" />\r
                                \r
                <!-- Set Ant project properties -->\r
+               <property name="release.tag" value="v${project.version}" />\r
                <property name="release.name" value="gitblit-${project.version}"/>\r
                <property name="distribution.zipfile" value="${release.name}.zip" />\r
                <property name="distribution.tgzfile" value="${release.name}.tar.gz" />\r
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
        -->\r
        <target name="releaseBinaries" depends="prepare" description="Publish the Gitblit binaries to a GitHub release">\r
-               <property name="project.tag" value="v${project.version}" />\r
 \r
                <ghReleaseDraft\r
-                       releaselog="${releaselog}"/>\r
+                       releaselog="${releaselog}"\r
+                   releasetag="${release.tag}"/>\r
 \r
                <echo>Uploading Gitblit ${project.version} binaries</echo>\r
 \r
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
        -->\r
        <target name="publishRelease" depends="prepare" description="Publish the GitHub release draft" >\r
-               <property name="project.tag" value="v${project.version}" />\r
 \r
                <echo>Publishing Gitblit ${project.version} release draft on GitHub</echo>\r
 \r
                        releaseVersion="${project.version}"/>\r
                <exec executable="bash" logError="true" >\r
                        <arg value="-c" />\r
-                       <arg value="${octokit} -q edit_release fzs gitblit ${ghrelease.id} tag_name='${project.tag}'"></arg>\r
+                       <arg value="${octokit} -q edit_release fzs gitblit ${ghrelease.id} tag_name='${release.tag}'"></arg>\r
                </exec>\r
                <ghPublishReleaseDraft\r
                        releaseid="${ghrelease.id}"/>\r
        -->\r
        <macrodef name="ghReleaseDraft">\r
                <attribute name="releaselog" />\r
+               <attribute name="releasetag" />\r
                <sequential>\r
                        <echo>Creating release ${project.tag} draft on GitHub</echo>\r
                        <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.id">\r
                                <arg value="-c" />\r
-                               <arg value="${octokit} create_release fzs gitblit ${project.tag} name=${project.version} draft=true | cut -f2"></arg>\r
+                               <arg value="${octokit} create_release fzs gitblit @{releasetag} name=${project.version} draft=true | cut -f2"></arg>\r
                        </exec>\r
                        <exec executable="bash" logError="true" failonerror="true" outputproperty="ghrelease.upldUrl">\r
                                <arg value="-c" />\r