带有私有GitHub存储库的Electron Autoupdater? [英] Electron Autoupdater with Private GitHub Repository?

查看:73
本文介绍了带有私有GitHub存储库的Electron Autoupdater?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用PRIVATE GitHub Repository实现了Electron AutoUpdater作为提供者来发布电子应用程序.现在,我可以使用GitHub存储库发布它,但是每当AutoUpdater尝试从GitHub存储库下载更新时,每次它提示时都显示响应代码404 Not found..我尝试在setFeedURL方法中传递令牌,并在GH_TOKEN中进行设置,但看起来像这样也不起作用.

  autoUpdater.setFeedURL({提供者:"github",所有者:"owner",repo:'repo-name',令牌:令牌",private:true}); 

那么,有什么方法可以使其与PRIVATE GitHub Repository一起使用?

解决方案

您是否正在使用电子自动-updater 模块?从API 文档中,我可以看到它们不支持./p>

另一方面,如果您使用的是 electron-updater 模块,请制作确保您遵循推荐的发布工作流程,并且您不应使用setFeedURL检查此处

已更新:

如果您使用的是 electron-updater ,并且您正在发布到私有存储库,则需要确保您的令牌在 app-update.yml 文件中可用,这就是为什么如果您未在 app-update.yml 文件,您将获得404.

对于电子更新程序,您可以将令牌自动添加到 app-update.yml 文件,令牌应在发布部分中进行设置,如下所示:

 发布":[{"provider":"github",私人":是的,"owner":< github_owner>","repo":< repo_name>","token":<您的github令牌>"}], 

这将产生一个 app-update.yml 文件,如下所示:

  owner:< github_owner>回购:< repo_name>提供者:github私人:真实令牌:<您的github令牌>updaterCacheDirName:电子更新程序专用更新程序 

检查此小型视频

这是我的代码 https://github.com/linuxjuggler/electron-auto-update-example 检查 electron-builder.json 文件.

更新2

基于快速设置指南部分中提到的注释,则永远不要调用 setFeedURL .

I have implemented Electron AutoUpdater with PRIVATE GitHub Repository as provider to publish electron application. Now, i can publish it using GitHub repository but Whenever AutoUpdater tries to download the updates from GitHub repository, Everytime it prompts with response code 404 Not found.. I have tried passing token in setFeedURL method and also set it in GH_TOKEN but seems like that does not work either.

autoUpdater.setFeedURL({ provider: 'github'
, owner: 'owner'
, repo: 'repo-name'
, token: 'token'
, private: true });

So, Is there any way to get it working with PRIVATE GitHub Repository ?

解决方案

Are you using electron auto-updater module? from the API documentation, I can see that they don't support.

On the other hand, if you are using electron-updater module, make sure that you are following the recommended release workflow, and you should not use setFeedURL check the note here

Updated:

If you are using electron-updater and you are publishing to a private repository, you will need to make sure that your token will be available within the app-update.yml file, that's why many say it's not recommended, if the token is not set in your app-update.yml file you will get 404.

For electron-updater to auto add your token to the app-update.yml file the token should be set within the publish section like the following:

  "publish": [
    {
      "provider": "github",
      "private": true,
      "owner": "<github_owner>",
      "repo": "<repo_name>",
      "token": "<your github token>"
    }
  ],

This will produce a app-update.yml file like the following:

owner: <github_owner>
repo: <repo_name>
provider: github
private: true
token: <your github token>
updaterCacheDirName: electron-updater-private-updater

Check this small video

Here is my code https://github.com/linuxjuggler/electron-auto-update-example check the electron-builder.json file.

Update 2

Based on the note mentioned in the Quick Setup Guide section, you should never call setFeedURL.

这篇关于带有私有GitHub存储库的Electron Autoupdater?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆