diff --git a/tasks/admin/components/update.js b/tasks/admin/components/update.js index b2ae347c17..3dac2bcee9 100644 --- a/tasks/admin/components/update.js +++ b/tasks/admin/components/update.js @@ -38,7 +38,7 @@ var version = project.version ; -module.exports = function() { +module.exports = function(callback) { var index = -1, @@ -58,6 +58,7 @@ module.exports = function() { index = index + 1; if(index >= total) { + callback(); return; } @@ -91,6 +92,7 @@ module.exports = function() { fileModeOptions = { args : 'config core.fileMode false', cwd: outputDirectory }, usernameOptions = { args : 'config user.name "' + oAuth.name + '"', cwd: outputDirectory }, emailOptions = { args : 'config user.email "' + oAuth.email + '"', cwd: outputDirectory }, + versionOptions = { args : 'rev-parse --verify HEAD', cwd: outputDirectory }, localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git')), canProceed = true @@ -132,19 +134,29 @@ module.exports = function() { ; } - // push changess to remote + // push changes to remote function pushFiles() { console.info('Pushing files for ' + component); git.push('origin', 'master', { args: '', cwd: outputDirectory }, function(error) { console.info('Push completed successfully'); - createRelease(); + getSHA(); + }); + } + + // gets SHA of last commit for creating release + function getSHA() { + git.exec(versionOptions, function(error, version) { + createRelease(version.trim()); }); } // create release on GitHub.com - function createRelease() { + function createRelease(version) { console.log('Tagging release as ', version); - github.releases.createRelease(releaseOptions, function() { + if(version) { + releaseOptions.target_commitish = version; + } + github.releases.editRelease(releaseOptions, function() { nextRepo(); }); } @@ -154,7 +166,7 @@ module.exports = function() { console.log('Sleeping for 1 second...'); // avoid rate throttling global.clearTimeout(timer); - timer = global.setTimeout(stepRepo, 1000); + timer = global.setTimeout(stepRepo, 500); } diff --git a/tasks/admin/distributions/update.js b/tasks/admin/distributions/update.js index 8f5f6c9628..2a5e49ebf6 100644 --- a/tasks/admin/distributions/update.js +++ b/tasks/admin/distributions/update.js @@ -38,7 +38,7 @@ var version = project.version ; -module.exports = function() { +module.exports = function(callback) { var index = -1, @@ -58,6 +58,7 @@ module.exports = function() { index = index + 1; if(index >= total) { + callback(); return; } @@ -90,6 +91,7 @@ module.exports = function() { fileModeOptions = { args : 'config core.fileMode false', cwd: outputDirectory }, usernameOptions = { args : 'config user.name "' + oAuth.name + '"', cwd: outputDirectory }, emailOptions = { args : 'config user.email "' + oAuth.email + '"', cwd: outputDirectory }, + versionOptions = { args : 'rev-parse --verify HEAD', cwd: outputDirectory }, localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git')), canProceed = true @@ -130,18 +132,28 @@ module.exports = function() { ; } - // push changess to remote + // push changes to remote function pushFiles() { - console.info('Pushing files for ' + distribution); + console.info('Pushing files for ' + component); git.push('origin', 'master', { args: '', cwd: outputDirectory }, function(error) { console.info('Push completed successfully'); - createRelease(); + getSHA(); + }); + } + + // gets SHA of last commit for creating release + function getSHA() { + git.exec(versionOptions, function(error, version) { + createRelease(version); }); } // create release on GitHub.com - function createRelease() { + function createRelease(version) { console.log('Tagging release as ', version); + if(version) { + releaseOptions.target_commitish = version; + } github.releases.createRelease(releaseOptions, function() { nextRepo(); }); diff --git a/tasks/admin/publish.js b/tasks/admin/publish.js index 2e196f9a0e..e80c86a50c 100644 --- a/tasks/admin/publish.js +++ b/tasks/admin/publish.js @@ -14,11 +14,12 @@ var ; /* Release All */ -module.exports = function() { +module.exports = function(callback) { runSequence( 'update distributions', // commit less/css versions to github - 'update components' // commit components to github + 'update components', // commit components to github + callback ); }; \ No newline at end of file diff --git a/tasks/admin/register.js b/tasks/admin/register.js index 70f4411e3c..dc604ec170 100644 --- a/tasks/admin/register.js +++ b/tasks/admin/register.js @@ -29,6 +29,7 @@ module.exports = function(callback) { stepRepo = function() { index = index + 1; if(index >= total) { + callback(); return; } var diff --git a/tasks/admin/release.js b/tasks/admin/release.js index 0eade99d17..a247e8bfac 100644 --- a/tasks/admin/release.js +++ b/tasks/admin/release.js @@ -15,14 +15,15 @@ var ; /* Release All */ -module.exports = function() { +module.exports = function(callback) { runSequence( //'build', // build Semantic 'init distributions', // sync with current github version 'create distributions', // update each repo with changes from master repo 'init components', // sync with current github version - 'create components' // update each repo + 'create components', // update each repo + callback ); }; \ No newline at end of file diff --git a/tasks/config/admin/release.js b/tasks/config/admin/release.js index 7b8cb18b42..ebfa090199 100644 --- a/tasks/config/admin/release.js +++ b/tasks/config/admin/release.js @@ -60,7 +60,7 @@ module.exports = { // components that get separate repositories for bower/npm components : [ - 'accordion', + 'accordion' 'ad', 'api', 'breadcrumb',