electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.66k stars 1.74k forks source link

Electron-updater does not support enterprise Github #1903

Closed dawangdw closed 7 years ago

dawangdw commented 7 years ago

The similar issue is found here. The main problem is electron-updater doesn't support enterprise Github. When I use demo code, I always got this

[2017-08-05 10:24:47:0781] [info] App starting...
[2017-08-05 10:24:48:0166] [info] Checking for update
[2017-08-05 10:24:48:0166] [info] Checking for update...
[2017-08-05 10:24:51:0834] [error] Error: Error: Unable to find latest version on GitHub (https://github.***.com/repos/<owner>/<repo>/releases/latest), please ensure a production release exists: HttpError: 406 Not Acceptable
" "
Headers: {
  "cache-control": [
    "no-cache, no-store"
  ],
  "connection": [
    "keep-alive"
  ],
...

Here is my publish config block

"build": {
   ...
    "publish": [{
        "provider": "github",
        "host": "github.***.com",
        "owner": "<owner>",
        "repo": "<repo>",
        "token": "<personal access token>"
      }]
}

I am using newest electron libraries

  "devDependencies": {
    "electron": "1.6.11",
    "electron-builder": "19.19.1"
  },
  "dependencies": {
    "electron-log": "2.2.7",
    "electron-updater": "2.8.2"
  },
develar commented 7 years ago

Problem for me — I cannot test it since I doesn't have GitHub enterprise server. Is it possible to provide me your real github enterprise config and (I don't know, is it required or not) add me as read-only user? You can contact me by email / or direct slack message.

dawangdw commented 7 years ago

@develar I replied you on the slack message, the main problem is that the URL should be https://github.***.com/api/v3/repos/<owner>/<repo>/releases/latest for enterprise Github, not https://github.***.com/repos/<owner>/<repo>/releases/latest. BTW, the electron-builder is using correct URL for enterprise Github to publish artifacts.

develar commented 7 years ago

@dawangdw Please try 2.8.9

naheller commented 6 years ago

@develar I am having a similar problem. How can I change the url from htps://github.***.com/api/v3/repos/<owner>/<repo>/releases/latest to https://github.***.com/repos/<owner>/<repo>/releases/latest?

applecool commented 5 years ago

@develar This is the exact problem which I am facing right now. How could I fix this?