hainproject / hain

An 'alt+space' launcher for Windows, built with Electron
http://hainproject.github.io/hain/
MIT License
3.2k stars 155 forks source link

Distribution for unix systems #98

Open ewnd9 opened 8 years ago

ewnd9 commented 8 years ago

After adding support to run hain on unix system (pull request https://github.com/appetizermonster/hain/pull/48), we need a way to distribute it.

npm

npm is convenient enough to install and update electron applications.

The main problem to publish on npm is two package.json files: https://github.com/appetizermonster/hain/blob/b1482b8dabbc026daac832af46557c402a1d5e70/package.json in the root of the project and https://github.com/appetizermonster/hain/blob/b1482b8dabbc026daac832af46557c402a1d5e70/app/package.json in the app folder.

What is a reason to split them?

*.deb packages for ubuntu/debian

Could be generated and uploaded via travis-ci.

MacOS packages

:question: probably could be generated only on mac systems

Gum-Joe commented 8 years ago

Hi @ewnd9. I think, to solve the problem of mac building, we could use some simple tricks, in a .travis.yml, to show that no language is set. This would mean we could load a MacOS worker on travis-ci and install nodejs on it, along with any other dependencies.

To add to this, to make an ubuntu distribution, a vm could be used (such as a vagrant vm).

NB: By 'we' I mean the hain developers.

appetizermonster commented 8 years ago

@ewnd9 the reason to split them is that electron-packager needs two package.json files to package app. one is for developing environment, another is for application environment. so, it's essential for now

Gum-Joe commented 8 years ago

@ewnd9 and @appetizermonster: Here's what I would do, for npm distribution:

  1. Create the directory dist/npm
  2. Add a package.json to dist/npm, along with an install script, to install hain, which is ran as part of the package.json's install hook
  3. Copy the binaries into dist/npm (or put them somewhere for the install script to download, such as s3)
  4. Publish what is in dist/npm

Of course, this could be inefficient as it would mean having 3 package.json files. To solve this, you could use the root package.json file and add a .npmignore to only include the binaries and/or the source code + README.md