@@ -129,23 +129,25 @@ module.exports = function (grunt) {
129129 }
130130 } ) ;
131131 } ) ;
132- grunt . registerTask ( 'publish-post-build' , function ( ) {
133- grunt . task . requires ( 'build-only' ) ;
134- var done = this . async ( ) ;
132+
133+ function commitRelease ( ) {
135134 var version = grunt . config . data . version ;
136135 var repository ;
137136 var index ;
138137 var oid ;
139138 var author = Git . Signature . create ( gitUser , gitEmail , Date . now ( ) , 0 ) ;
140- Git . Repository . open ( '.' )
139+ return Git . Repository . open ( '.' )
141140 . then ( function ( repo ) {
142141 repository = repo ;
143- return repo . refreshIndex ( ) ;
142+ } )
143+ . then ( function ( ) {
144+ return repository . refreshIndex ( ) ;
144145 } )
145146 . then ( function ( indexRes ) {
146147 index = indexRes ;
147148 return index . addAll ( ) ;
148- } ) . then ( function ( ) {
149+ } )
150+ . then ( function ( ) {
149151 return index . write ( ) ;
150152 } ) . then ( function ( ) {
151153 return index . writeTree ( ) ;
@@ -155,7 +157,7 @@ module.exports = function (grunt) {
155157 } ) . then ( function ( parent ) {
156158 return repository . createCommit ( 'HEAD' , author , author , '[ci skip] Build Version ' + version , oid , [ parent ] ) ;
157159 } ) . then ( function ( id ) {
158- return repository . createTag ( id , version , 'Release v' + version ) ;
160+ return Git . Tag . create ( repository , version , id , author , 'Release v' + version ) ;
159161 } ) . then ( function ( ) {
160162 return repository . getRemote ( 'origin' ) ;
161163 } )
@@ -174,7 +176,13 @@ module.exports = function (grunt) {
174176 }
175177 }
176178 ) ;
177- } )
179+ } ) ;
180+ }
181+
182+ grunt . registerTask ( 'publish-post-build' , function ( ) {
183+ grunt . task . requires ( 'build-only' ) ;
184+ var done = this . async ( ) ;
185+ commitRelease ( )
178186 . then ( function ( ) {
179187 done ( ) ;
180188 } ) . catch ( function ( e ) {
0 commit comments