有没有办法设置electron builder自动更新程序来检查来自Google云存储的更新?

有没有办法设置electron builder自动更新程序来检查来自Google云存储的更新?,electron,google-cloud-storage,electron-builder,electron-updater,Electron,Google Cloud Storage,Electron Builder,Electron Updater,我想使用electron builder的自动更新程序来更新我的应用程序。我没有使用Github发行版,因为我有一个私人回购协议,不想出于安全目的包含GH_令牌。相反,我想将二进制文件和最新的.yml/latest-mac.yml文件放入Google存储桶中 我知道可以使用通用提供程序检查更新。但目前,我甚至无法让electron builder阅读最新的.yml。我花了好几个小时研究文档和其他github/stack溢出问题,但没有找到任何解决方法 以下是我在main.js中为electron

我想使用electron builder的自动更新程序来更新我的应用程序。我没有使用Github发行版,因为我有一个私人回购协议,不想出于安全目的包含GH_令牌。相反,我想将二进制文件和最新的.yml/latest-mac.yml文件放入Google存储桶中

我知道可以使用通用提供程序检查更新。但目前,我甚至无法让electron builder阅读最新的.yml。我花了好几个小时研究文档和其他github/stack溢出问题,但没有找到任何解决方法

以下是我在
main.js
中为electron/auto updater设置新提要URL的代码-

const data = {
  provider: 'generic',
  url: 'https://storage.cloud.google.com/my-project', //'my-project' is the name of the bucket
  channel: 'latest',
};
autoUpdater.setFeedURL(data);
autoUpdater.autoDownload = false;
autoUpdater.checkForUpdates();
内置的应用程序和yml文件都在该存储桶中。当我尝试运行我的应用程序时,我得到了一个巨大的错误,基本上只是通过谷歌云存储HTML/CSS复制,而不是读取和处理最新的.yml文件

Error: Error: Cannot parse update info from latest-mac.yml in the latest release artifacts (https://storage.cloud.google.com/my-project/latest-mac.yml?noCache=1dh4pdr5e): YAMLException: end of the stream or a document separator is expected at line 11, column 14:
       font-family: 'Open Sans';
                  ^
     at generateError (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
     at throwError (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
     at readDocument (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:1539:5)
     at loadDocuments (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
     at load (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:1596:19)
     at safeLoad (/Users/somelocation/documents/some-project/node_modules/js-yaml/lib/js-yaml/loader.js:1618:10)
     at parseUpdateInfo (/Users/somelocation/documents/some-project/node_modules/electron-updater/out/providers/Provider.js:131:37)
     at GenericProvider.getLatestVersion (/Users/somelocation/documents/some-project/node_modules/electron-updater/out/providers/GenericProvider.js:57:48)
     at processTicksAndRejections (internal/process/task_queues.js:86:5)
     at async MacUpdater.getUpdateInfoAndProvider (/Users/somelocation/documents/some-project/node_modules/electron-updater/out/AppUpdater.js:488:13), rawData:
 <!DOCTYPE html>
 <html lang="en">
   <head>
   <meta charset="utf-8">
   <meta content="width=300, initial-scale=1" name="viewport">
   <meta name="google-site-verification" content="LrdTUW9psUAMbh4Ia074-BPEVmcpBxF6Gwf0MSgQXZs">
   <title>Sign in - Google Accounts</title>
错误:错误:无法解析最新版本工件中最新-mac.yml的更新信息(https://storage.cloud.google.com/my-project/latest-mac.yml?noCache=1dh4pdr5e):YAMLException:第11行第14列应为流结尾或文档分隔符:
字体系列:“开放式SAN”;
^
在generateError(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:167:10)
at throwError(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:173:9)
在readDocument(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:1539:5)
在loadDocuments(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:1575:5)
加载时(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:1596:19)
安全加载时(/Users/somelocation/documents/some project/node_modules/js yaml/lib/js yaml/loader.js:1618:10)
在parseUpdateInfo(/Users/somelocation/documents/some project/node_modules/electron updater/out/providers/Provider.js:131:37)
在GenericProvider.getlatest版本(/Users/somelocation/documents/some project/node_modules/electron updater/out/providers/GenericProvider.js:57:48)
在处理和拒绝时(内部/process/task_queues.js:86:5)
在async MacUpdater.GetUpdateInfo提供程序(/Users/somelocation/documents/some project/node_modules/electron updater/out/AppUpdater.js:488:13)中,原始数据:
登录-谷歌帐户

是否可以从Google云存储桶而不是S3或Github读取文件?此外,我已经尝试从yml文件中删除额外的行或制表符。

尝试在应用程序“就绪”事件后执行此代码

app.on('ready', () => {
    const feedURL = 'https://storage.cloud.google.com/my-project';
    autoUpdater.setFeedURL(feedURL); 
    autoUpdater.checkForUpdates(); 
});

您应该使用GCPAPI而不是浏览器URL

这个代码对我有用:

"publish": {
   "provider": "generic",
   "url": "https://storage.googleapis.com/YOUR_BUCKET/"
}

也可以使用,但它需要OAuth

您找到解决方案了吗?没有,我们使用了另一种方式来存储自动更新程序文件。