Repository: electron-userland/electron-forge
Pull request #407 (2018-01-10 05:37:54)

Upgrade dependencies
* [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).
* [x] The changes have sufficient test coverage (if applicable).
* [x] The testsuite passes successfully on my local machine (if applicable).

**Summarize your changes:**

* [`fs-extra`](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md#500--2017-12-11) - refactored `fs.copy`
* [`inquirer`](https://github.com/SBoudrias/Inquirer.js/releases/tag/v5.0.0) - breaking change not applicable to us, I don't think
* [`@octokit/rest`](https://github.com/octokit/rest.js/releases/tag/v13.0.0) - refactored upload asset API, renamed from `github`, among other things
* [`electron-installer-debian`](https://github.com/unindented/electron-installer-debian/blob/master/NEWS.md#080---2018-01-18) - promise support
* [`mocha`](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#500--2018-01-17) - breaking change not applicable to us



malept: Added `electron-installer-debian`.

Patch:
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/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', {