-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move github release checking to node.js
Our upload script was relying on an old python script to find the GitHub release for uploading.
- Loading branch information
John Kleinschmidt
committed
Jul 10, 2018
1 parent
90339b7
commit 2040095
Showing
3 changed files
with
63 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const GitHub = require('github') | ||
const github = new GitHub() | ||
|
||
if (process.argv.length < 3) { | ||
console.log('Usage: find-release version') | ||
process.exit(1) | ||
} | ||
|
||
const version = process.argv[2] | ||
|
||
async function findRelease () { | ||
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN}) | ||
let releases = await github.repos.getReleases({ | ||
owner: 'electron', | ||
repo: 'electron' | ||
}) | ||
let targetRelease = releases.data.find(release => { | ||
return release.tag_name === version | ||
}) | ||
let returnObject = {} | ||
|
||
if (targetRelease) { | ||
returnObject = { | ||
id: targetRelease.id, | ||
draft: targetRelease.draft, | ||
exists: true | ||
} | ||
} else { | ||
returnObject = { | ||
exists: false, | ||
draft: false | ||
} | ||
} | ||
console.log(JSON.stringify(returnObject)) | ||
} | ||
|
||
findRelease() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters