Skip to content

Commit

Permalink
Changed tag creation method to apply a valid creator/author to the tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanaye committed Feb 1, 2017
1 parent 461ea16 commit 3c0135a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions build/tasks/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,25 @@ module.exports = function (grunt) {
}
});
});
grunt.registerTask('publish-post-build', function () {
grunt.task.requires('build-only');
var done = this.async();

function commitRelease () {
var version = grunt.config.data.version;
var repository;
var index;
var oid;
var author = Git.Signature.create(gitUser, gitEmail, Date.now(), 0);
Git.Repository.open('.')
return Git.Repository.open('.')
.then(function (repo) {
repository = repo;
return repo.refreshIndex();
})
.then(function () {
return repository.refreshIndex();
})
.then(function (indexRes) {
index = indexRes;
return index.addAll();
}).then(function () {
})
.then(function () {
return index.write();
}).then(function () {
return index.writeTree();
Expand All @@ -155,7 +157,7 @@ module.exports = function (grunt) {
}).then(function (parent) {
return repository.createCommit('HEAD', author, author, '[ci skip] Build Version ' + version, oid, [parent]);
}).then(function (id) {
return repository.createTag(id, version, 'Release v'+version);
return Git.Tag.create(repository, version, id, author, 'Release v'+version);
}).then(function () {
return repository.getRemote('origin');
})
Expand All @@ -174,7 +176,13 @@ module.exports = function (grunt) {
}
}
);
})
});
}

grunt.registerTask('publish-post-build', function () {
grunt.task.requires('build-only');
var done = this.async();
commitRelease()
.then(function () {
done();
}).catch(function (e) {
Expand Down

0 comments on commit 3c0135a

Please sign in to comment.