Skip to content

Commit

Permalink
chore(generic): upgrade github to v13
Browse files Browse the repository at this point in the history
releases uploadAsset API was changed
  • Loading branch information
malept committed Jan 27, 2018
1 parent 0ecc57d commit a80ff50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@
"electron-rebuild": "^1.6.0",
"form-data": "^2.1.4",
"fs-extra": "^5.0.0",
"github": "^12.0.3",
"github": "^13.1.0",
"glob": "^7.1.1",
"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",
Expand Down
10 changes: 6 additions & 4 deletions src/publishers/github.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fs from 'fs-extra';
import mime from 'mime-types';
import path from 'path';

import asyncOra from '../util/ora-handler';
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit a80ff50

Please sign in to comment.