Add circle-ci API call

This commit is contained in:
GamingLiamStudios 2022-02-07 21:25:58 +11:00
parent b19b0d4e39
commit 0568fe9282
No known key found for this signature in database
GPG key ID: 3650DE4EAFF62ADD

View file

@ -564,6 +564,16 @@ export class BrowserWindow {
});
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 = {
provider: 'generic',
url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL