Repository: electron-userland/electron-forge
Pull request #424 (2018-01-26 05:35:26)

Add SUPPORT
* [x] I have read the [contribution documentation](https://github.com/electron-userland/electron-forge/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project follows, as appropriate.
* [x] The changes are appropriately documented (if applicable).

**Summarize your changes:**

Adds a support doc with more possible values for `DEBUG`, and a table of contents for the README.



Patch:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6c81bd846..e51fc88bf 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -26,24 +26,8 @@ sites](https://github.com/electron/electron#community).
 
 ### Debugging
 
-One way to troubleshoot potential problems is to set the `DEBUG` environment variable before
-running `electron-forge`. This will print debug information from the specified modules. The
-value of the environment variable is a comma-separated list of modules which support this logging
-feature. Known modules include:
-
-* `electron-download`
-* `electron-forge:*` (always use this one before filing an issue)
-* `electron-osx-sign`
-* `electron-packager`
-* `extract-zip`
-* `get-package-info`
-
-We use the [`debug`](https://www.npmjs.com/package/debug#usage) module for this functionality. It
-has examples on how to set environment variables if you don't know how.
-
-**If you are using `npm run` to execute `electron-forge`, run the `electron-forge` command
-without using `npm run` and make a note of the output, because `npm run` does not print out error
-messages when a script errors.**
+Troubleshooting suggestions can be found in the [support
+documentation](https://github.com/electron-userland/electron-forge/blob/master/SUPPORT.md#troubleshooting).
 
 ## Contribution suggestions
 
diff --git a/README.md b/README.md
index c14aa0f81..17e85814d 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,16 @@ Electron Forge unifies the existing (and well maintained) build tools for
 Electron development into a simple, easy to use package so that anyone can
 jump right in to Electron development.
 
+----
+
+[Website](https://electronforge.io) |
+[Goals](#project-goals) |
+[Usage](#usage) |
+[Configuration](#config) |
+[Support](https://github.com/electron-userland/electron-forge/blob/master/SUPPORT.md) |
+[Contributing](https://github.com/electron-userland/electron-forge/blob/master/CONTRIBUTING.md) |
+[Changelog](https://github.com/electron-userland/electron-forge/blob/master/CHANGELOG.md)
+
 # Getting Started
 
 **Note**: Electron Forge requires Node 6 or above, plus git installed.
diff --git a/SUPPORT.md b/SUPPORT.md
new file mode 100644
index 000000000..fecda0fea
--- /dev/null
+++ b/SUPPORT.md
@@ -0,0 +1,33 @@
+# Support for Electron Forge
+
+If you have questions about usage, we encourage you to browse the [website](https://electronforge.io/),
+and visit one of the several [community-driven sites](https://github.com/electron/electron#community).
+
+## Troubleshooting
+
+One way to troubleshoot potential problems is to set the `DEBUG` environment variable before
+running `electron-forge`. This will print debug information from the specified modules. The
+value of the environment variable is a comma-separated list of modules which support this logging
+feature. Known modules include:
+
+* `electron-compile:*`
+* `electron-download`
+* `electron-forge:*` (always use this one before filing an issue)
+* `electron-installer-debian`
+* `electron-installer-dmg`
+* `electron-installer-flatpak`
+* `electron-installer-redhat`
+* `electron-osx-sign`
+* `electron-packager`
+* `electron-rebuild`
+* `electron-windows-installer:main`
+* `electron-windows-store`
+* `extract-zip`
+* `get-package-info`
+
+We use the [`debug`](https://www.npmjs.com/package/debug#usage) module for this functionality. It
+has examples on how to set environment variables if you don't know how.
+
+**If you are using `npm run` to execute `electron-forge`, run the `electron-forge` command
+without using `npm run` and make a note of the output, because `npm run` does not print out error
+messages when a script errors.**
diff --git a/package.json b/package.json
index 5bb206da8..58c4d58c7 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
     "generate-changelog": "^1.0.2",
     "gulp": "^3.9.1",
     "gulp-babel": "^6.1.2",
-    "mocha": "^4.0.1",
+    "mocha": "^5.0.0",
     "nodemon": "^1.11.0",
     "nyc": "^11.0.0",
     "proxyquire": "^1.7.10",
@@ -106,6 +106,7 @@
     "cache": true
   },
   "dependencies": {
+    "@octokit/rest": "^14.0.4",
     "aws-sdk": "^2.9.0",
     "babel-register": "^6.16.3",
     "bluebird": "^3.4.6",
@@ -120,13 +121,13 @@
     "electron-packager": "^10.1.0",
     "electron-rebuild": "^1.6.0",
     "form-data": "^2.1.4",
-    "fs-extra": "^4.0.0",
-    "github": "^12.0.3",
+    "fs-extra": "^5.0.0",
     "glob": "^7.1.1",
-    "inquirer": "^4.0.0",
+    "inquirer": "^5.0.0",
     "lodash.merge": "^4.6.0",
     "lodash.template": "^4.4.0",
     "log-symbols": "^2.0.0",
+    "mime-types": "^2.1.17",
     "node-fetch": "^1.6.3",
     "node-gyp": "^3.4.0",
     "nugget": "^2.0.1",
@@ -152,7 +153,7 @@
     }
   },
   "optionalDependencies": {
-    "electron-installer-debian": "^0.7.1",
+    "electron-installer-debian": "^0.8.0",
     "electron-installer-dmg": "^0.2.0",
     "electron-installer-flatpak": "^0.8.0",
     "electron-installer-redhat": "^0.5.0",
diff --git a/src/makers/linux/deb.js b/src/makers/linux/deb.js
index dc314f3a3..854b275f7 100644
--- a/src/makers/linux/deb.js
+++ b/src/makers/linux/deb.js
@@ -1,5 +1,4 @@
 import path from 'path';
-import pify from 'pify';
 
 import { ensureFile } from '../../util/ensure-output';
 import isInstalled from '../../util/is-installed';
@@ -34,6 +33,6 @@ export default async ({ dir, targetArch, forgeConfig, packageJSON }) => {
     outPath,
   });
 
-  await pify(installer)(debianConfig);
+  await installer(debianConfig);
   return [outPath];
 };
diff --git a/src/publishers/github.js b/src/publishers/github.js
index c2eda8ae3..4c276e3dd 100644
--- a/src/publishers/github.js
+++ b/src/publishers/github.js
@@ -1,3 +1,5 @@
+import fs from 'fs-extra';
+import mime from 'mime-types';
 import path from 'path';
 
 import asyncOra from '../util/ora-handler';
@@ -57,10 +59,10 @@ export default async (artifacts, packageJSON, forgeConfig, authToken, tag) => {
           return done();
         }
         await github.getGitHub().repos.uploadAsset({
-          owner: forgeConfig.github_repository.owner,
-          repo: forgeConfig.github_repository.name,
-          id: release.id,
-          filePath: artifactPath,
+          url: release.upload_url,
+          file: fs.createReadStream(artifactPath),
+          contentType: mime.lookup(artifactPath) || 'application/octet-stream',
+          contentLength: (await fs.stat(artifactPath)).size,
           name: path.basename(artifactPath),
         });
         return done();
diff --git a/src/publishers/s3.js b/src/publishers/s3.js
index bc85abd98..46d2ee06d 100644
--- a/src/publishers/s3.js
+++ b/src/publishers/s3.js
@@ -15,18 +15,22 @@ AWS.util.update(AWS.S3.prototype, {
 
 export default async (artifacts, packageJSON, forgeConfig, authToken, tag) => {
   const s3Config = forgeConfig.s3;
+
   s3Config.secretAccessKey = s3Config.secretAccessKey || authToken;
-  if (!(s3Config.accessKeyId && s3Config.secretAccessKey && s3Config.bucket)) {
+
+  const s3Client = new AWS.S3({
+    accessKeyId: s3Config.accessKeyId,
+    secretAccessKey: s3Config.secretAccessKey,
+  });
+
+  if (!s3Client.config.credentials || !s3Config.bucket) {
     throw 'In order to publish to s3 you must set the "s3.accessKeyId", "process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY" and "s3.bucket" properties in your forge config. See the docs for more info'; // eslint-disable-line
   }
 
   d('creating s3 client with options:', s3Config);
 
   const client = s3.createClient({
-    s3Client: new AWS.S3({
-      accessKeyId: s3Config.accessKeyId || process.env.AWS_ACCESS_KEY_ID,
-      secretAccessKey: s3Config.secretAccessKey || process.env.AWS_SECRET_ACCESS_KEY,
-    }),
+    s3Client,
   });
   client.s3.addExpect100Continue = () => {};
 
diff --git a/src/util/github.js b/src/util/github.js
index 65d808249..6ba7f8382 100644
--- a/src/util/github.js
+++ b/src/util/github.js
@@ -1,4 +1,4 @@
-import GitHubAPI from 'github';
+import GitHubAPI from '@octokit/rest';
 
 export default class GitHub {
   constructor(authToken, requireAuth) {


Test patch:
diff --git a/test/fast/github_spec.js b/test/fast/github_spec.js
index 67fa8b628..a2e5bd8c5 100644
--- a/test/fast/github_spec.js
+++ b/test/fast/github_spec.js
@@ -21,7 +21,7 @@ describe('GitHub', () => {
       }
     };
     GitHub = proxyquire.noCallThru().load('../../src/util/github', {
-      github: MockGitHub,
+      '@octokit/rest': MockGitHub,
     }).default;
   });
 
diff --git a/test/fast/makers/deb_spec.js b/test/fast/makers/deb_spec.js
index 8ef4c8a07..c2883caef 100644
--- a/test/fast/makers/deb_spec.js
+++ b/test/fast/makers/deb_spec.js
@@ -20,7 +20,7 @@ describe('deb maker', () => {
 
   beforeEach(() => {
     ensureFileStub = stub().returns(Promise.resolve());
-    eidStub = stub().callsArg(1);
+    eidStub = stub().resolves();
     forgeConfig = { electronInstallerDebian: {} };
 
     debModule = proxyquire.noPreserveCache().noCallThru().load('../../../src/makers/linux/deb', {