Skip to content

Commit

Permalink
Merge pull request eslint#2650 from gcochard/fix-2640
Browse files Browse the repository at this point in the history
Build: Stringify payload of release notes (fixes eslint#2640)
  • Loading branch information
ilyavolodin committed Jun 6, 2015
2 parents e4d903b + 8cab0e2 commit 7bd1ae1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
rules:
indent: 2
brace-style: [2, "1tbs"]
camelcase: [2, { properties: "never" }]
comma-style: [2, "last"]
default-case: 2
func-style: [2, "declaration"]
Expand Down
53 changes: 26 additions & 27 deletions Makefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var path = require("path"),
markdownlint = require("markdownlint"),
nodeCLI = require("shelljs-nodecli"),
os = require("os"),
semver = require("semver");
// ghGot = require("gh-got");
semver = require("semver"),
ghGot = require("gh-got");

//------------------------------------------------------------------------------
// Settings
Expand Down Expand Up @@ -111,15 +111,14 @@ function execSilent(cmd) {
* @returns {void}
*/
function release(type) {
var newVersion; /*, changes; */
var newVersion, changes;

target.test();
echo("Generating new version");
newVersion = execSilent("npm version " + type).trim();

echo("Generating changelog");
// changes =
target.changelog();
changes = target.changelog();

// add changelog to commit
exec("git add CHANGELOG.md");
Expand All @@ -133,30 +132,30 @@ function release(type) {
exec("git push origin master --tags");

// now push the changelog...changes to the tag
// echo("Publishing changes to github release");
echo("Publishing changes to github release");
// this requires a github API token in process.env.ESLINT_GITHUB_TOKEN
// it will continue with an error message logged if not set
// ghGot("repos/eslint/eslint/releases", {
// body: {
// "tag_name": newVersion,
// name: newVersion,
// "target_commitish": "master",
// body: changes
// },
// method: "POST",
// json: true,
// token: process.env.ESLINT_GITHUB_TOKEN
// }, function(pubErr) {
// if (pubErr) {
// echo("Warning: error when publishing changes to github release: " + pubErr.message);
// }
echo("Publishing to npm");
exec("npm publish");

echo("Generating site");
target.gensite();
target.publishsite();
// });
ghGot("repos/eslint/eslint/releases", {
body: JSON.stringify({
tag_name: newVersion,
name: newVersion,
target_commitish: "master",
body: changes
}),
method: "POST",
json: true,
token: process.env.ESLINT_GITHUB_TOKEN
}, function(pubErr) {
if (pubErr) {
echo("Warning: error when publishing changes to github release: " + pubErr.message);
}
echo("Publishing to npm");
exec("npm publish");

echo("Generating site");
target.gensite();
target.publishsite();
});
}

/**
Expand Down

0 comments on commit 7bd1ae1

Please sign in to comment.