Add circle-ci API call
This commit is contained in:
parent
b19b0d4e39
commit
0568fe9282
1 changed files with 30 additions and 20 deletions
|
@ -564,6 +564,16 @@ export class BrowserWindow {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('check-for-update', async (_event) => {
|
ipcMain.on('check-for-update', async (_event) => {
|
||||||
|
const branch = utils.getStoreValue('general.update_branch')
|
||||||
|
let latestbranch = await fetch(`https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=${branch}&filter=successful`)
|
||||||
|
if (latestbranch.status != 200) {
|
||||||
|
console.log(`Error fetching latest artifact from the **${branch}** branch`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let latestbranchjson = await latestbranch.json()
|
||||||
|
console.log('Artifact - ', latestbranchjson[0].url)
|
||||||
|
|
||||||
const options: any = {
|
const options: any = {
|
||||||
provider: 'generic',
|
provider: 'generic',
|
||||||
url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL
|
url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue