megahertz / electron-simple-publisher

Simple way to publish releases for electron-simple-updater
MIT License
66 stars 25 forks source link

Local publisher #3

Closed giacgbj closed 7 years ago

giacgbj commented 7 years ago

Would be possible to add a parameter to create "updates.json" locally without the need to publish it somewhere else?

megahertz commented 7 years ago

Do you mean that instead of publishing of all files you just want to create the updates.json with relative links inside?

giacgbj commented 7 years ago

Yes I do: I mean the same "updates.json" is produced now, using the absolute urls that are created now, but in a local directory (this would be the new parameter), leaving out the publishing phase.

megahertz commented 7 years ago

It's not possible to get absolute url to some asset without real publishing because the file url is returned by transport only after real uploading. So the only way for this situation is to get relative links.

megahertz commented 7 years ago

But it's possible to extend existed transport and override uploadFile method which will only return a link.

giacgbj commented 7 years ago

Would it be too difficult to refactor the code in order to create a new "transport" method which could contain at minimum the following configurations?

{
  "transport": {
    "module": "local",
    "localDir": "dist",
    "remoteUrl": "http://example.com/updates",
  }
}

It would generate locally in "dist" directory the release directories with the artifacts and the file "updates.json" which should be something like:

{
  "darwin-x64-prod": {
    "update": "https://example.com/updates/darwin-x64-prod-v0.5.0/release.json",
    "install": "https://example.com/updates/darwin-x64-prod-v0.5.0/App-0.5.0.dmg",
    "version": "0.5.0"
  }

Directory tree:

megahertz commented 7 years ago

It's not difficult, but I don't know when I'll have time for it.