Skip to content

Commit

Permalink
Build: Tag docs, publish release notes (fixes #6892) (#6934)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas authored and ilyavolodin committed Aug 22, 2016
1 parent 0cf1d55 commit 16db93a
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions Makefile.js
Expand Up @@ -235,6 +235,27 @@ function generateRuleIndexPage(basedir) {
output.to(outputFile);
}

/**
* Commits the changes in the site and publishes them to GitHub.
* @param {string} [tag] The string to tag the commit with.
* @returns {void}
*/
function publishSite(tag) {
const currentDir = pwd();

cd(SITE_DIR);
exec("git add -A .");
exec("git commit -m \"Autogenerated new docs and demo at " + dateformat(new Date()) + "\"");

if (tag) {
exec("git tag " + tag);
}

exec("git fetch origin && git rebase origin/master");
exec("git push origin master --tags");
cd(currentDir);
}

/**
* Creates a release version tag and pushes to origin.
* @param {boolean} [ciRelease] Set to true to indicate this is a CI release.
Expand All @@ -247,9 +268,11 @@ function release(ciRelease) {
echo("Generating site");
target.gensite();
generateBlogPost(releaseInfo);
target.publishsite();

publishSite("v" + releaseInfo.version);
echo("Site has been published");

echo("Publishing to GitHub");
ReleaseOps.publishReleaseToGitHub(releaseInfo);
}

/**
Expand Down Expand Up @@ -698,17 +721,6 @@ target.gensite = function(prereleaseVersion) {
generateFormatterExamples(getFormatterResults(), prereleaseVersion);
};

target.publishsite = function() {
const currentDir = pwd();

cd(SITE_DIR);
exec("git add -A .");
exec("git commit -m \"Autogenerated new docs and demo at " + dateformat(new Date()) + "\"");
exec("git fetch origin && git rebase origin/master");
exec("git push origin master");
cd(currentDir);
};

target.browserify = function() {

// 1. create temp and build directory
Expand Down Expand Up @@ -1116,6 +1128,10 @@ target.ciRelease = function() {
release(true);
};

target.publishsite = function() {
publishSite();
};

target.prerelease = function(args) {
prerelease(args[0]);
};

0 comments on commit 16db93a

Please sign in to comment.