Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a package builder that generates installers for Win, Mac and Linux #508

Closed
2 tasks
flyingzumwalt opened this issue May 8, 2017 · 32 comments · Fixed by #514
Closed
2 tasks

Add a package builder that generates installers for Win, Mac and Linux #508

flyingzumwalt opened this issue May 8, 2017 · 32 comments · Fixed by #514
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue

Comments

@flyingzumwalt
Copy link
Contributor

Everyday users want to use a native OS installer to install apps. In order to support this, we need to use a package builder like electron-builder to generate those installers.

What to do:

  • Add an electron package builder like electron-builder that gan generate installers for Windows, Mac and Linux
  • Configure the builder so we can automatically generate new installers and release them to dist.ipfs.io

There's some helpful, but slightly outdated, info in #20.

Related Issues: closes #16, closes #20

@daviddias
Copy link
Member

This is now possible thanks to the work @thisconnect did on js-ipfsd-ctl. @hacdias does this sound like something you can tackle as well? You can find docs on packaging left by @thisconnect here: https://github.com/ipfs/js-ipfsd-ctl#packaging

@hacdias
Copy link
Member

hacdias commented Nov 28, 2017

So, this is related to #512. Dear CI master @victorbjelkholm, the command to build the distributables is:

./node_modules/.bin/electron-forge package --arch=ia32,x64 --platform=win32,linux,darwin

You just need to change the arch and platform flags to build for the desired platforms and arches. The output will be saved on:

./out/{package_type}/{arch}/files_are_here

If it simplifies your life, there is the publish command you can use: https://electronforge.io/cli/publish.

Hope it helps!

@victorb
Copy link
Member

victorb commented Nov 29, 2017

@hacdias started working on this here: #514 still a work in progress.

@hacdias
Copy link
Member

hacdias commented Dec 7, 2017

Let's just leave this opened until Packaging is fully working.

@hacdias hacdias reopened this Dec 7, 2017
@hacdias
Copy link
Member

hacdias commented Dec 7, 2017

Sooooo! Since @diasdavid merged #514, Jenkins is actually building the right stuff! And the binary for Windows is running flawlessly and I'm very happy with it!!! Thanks @victorbjelkholm!!!

Although, there is this "problem" on Windows:

image

We have to sign it somehow as it is stated here so the publisher is recognized and this message doesn't prompt out.

On Ubuntu/Mint this problem persists.

@victorb
Copy link
Member

victorb commented Dec 7, 2017

@hacdias woah! That's great news! Hm, signing will be a bit trickier to solve right now, as we don't have secrets-management in jenkins yet but it's planned already because we have other builds that will need it as well.

I think this same problem happens in macOS (you'll need to right-click and then click open instead of double-click, otherwise you get a similar dialog) so maybe not a blocker for now.

@hacdias
Copy link
Member

hacdias commented Dec 7, 2017

@victorbjelkholm okay then. Soooo, the only problem are the Linux builds! Those don't add an icon nor anything to the path. I'll try to figure out why.

@daviddias
Copy link
Member

@victorbjelkholm @hacdias can we start adding the working builds (Windows and Mac OS X) to https://dist.ipfs.io/ ?

@victorb
Copy link
Member

victorb commented Dec 11, 2017

Manually verified ones, I don't see a problem with that.

However, automatic releases (from jenkins point of view) is missing trusted workers and dealing with secrets from within build jobs. Also, from Stations point of view, we would need to have some sort of testing before automatically release things.

@hacdias
Copy link
Member

hacdias commented Dec 11, 2017

Only Windows and macOS builds are working correctly right now, right?

@daviddias daviddias added exp/expert Having worked on the specific codebase is important and removed exp/intermediate Prior experience is likely helpful labels Dec 14, 2017
@daviddias
Copy link
Member

daviddias commented Dec 14, 2017

As per @victorbjelkholm :

09:13 <@daviddias> victorbjelkholm: let's ship those ipfs-station builds!
09:14 <@victorbjelkholm> daviddias: ship as in? Already being built for the three platforms
09:15 <@daviddias> is that so?? https://github.com/ipfs-shipyard/station/issues/508 doesn't tell me that
09:15 <@daviddias> awesome though!

We are ready to make a release! @hacdias would you like to do the honors and fill https://github.com/ipfs-shipyard/station/releases/tag/untagged-50a0768f417fccfc1ed1?

Rough task list:

  • Fill in the release info
  • Bump package.json version to 0.3.0 (6e3b3ac)
  • Upload binaries to the release
  • Write a blog post announcing it

@daviddias
Copy link
Member

Do we need Apple and Windows developer accounts to get the releases signed?

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

@daviddias
Copy link
Member

daviddias commented Dec 14, 2017

@lgierth would love your thoughts here (Release Signing)

I'm wondering if we can have a Alpha Release Key that specifically says that all the software is very Alpha and so it should not be trusted independently of the signature checking out.

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

@victorbjelkholm you can set the script to remove the .nupkg files since they aren't needed.

Linux builds are only working with sudo. Permissions are wrong. Can it be a build related thing?

I really want to check this today and let this finished today. I'm not sure if I will be able to do so, but I'll try. Will update this this afternoon.

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

@diasdavid can you check if the latest macOS build works?

@daviddias
Copy link
Member

Had to give perms for it to run on the Security pane of System Preferences, but yeah, it works!

image

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

Nice! The only problem then is on debian.

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

So, I solved the problem on debian but i need your help @victorbjelkholm:

See this:

https://ci.ipfs.team/blue/organizations/jenkins/IPFS%20Shipyard%2Fstation/detail/master/5/pipeline/15#step-51-log-23

Can you set postinst.sh permissions to be 755 before starting the build? 😄

@victorb
Copy link
Member

victorb commented Dec 14, 2017 via email

@hacdias
Copy link
Member

hacdias commented Dec 14, 2017

Don't worry, you just need to change the perms of that file. That file is the fix for the debian package 📦

@ghost
Copy link

ghost commented Dec 14, 2017

@lgierth would love your thoughts here (Release Signing)

Puh good question -- prior discussions: ipfs/distributions#51

We have a demand for signing web extensions too.

@hacdias
Copy link
Member

hacdias commented Dec 15, 2017

@victorbjelkholm hello! How's the state of this?

@hacdias
Copy link
Member

hacdias commented Dec 17, 2017

@victorbjelkholm ping.

@victorb
Copy link
Member

victorb commented Dec 17, 2017

solved in c2e703c

@hacdias
Copy link
Member

hacdias commented Dec 21, 2017

@diasdavid @victorbjelkholm I think the version from master is ready to be shipped and I'm not aware of any bugs it might have. What do you think?

@victorb
Copy link
Member

victorb commented Dec 21, 2017

@hacdias if everything has been tested with those specific binaries, then I say go for it! 👍 My only reservation is towards automatic builds + publish without having any automatic tests.

@hacdias
Copy link
Member

hacdias commented Dec 21, 2017

@victorbjelkholm we can skip automatic builds for now until we have tests 😄

@diasdavid let's do this?

@daviddias
Copy link
Member

What's the real blocker with automatic builds?

@hacdias
Copy link
Member

hacdias commented Dec 30, 2017

So, we don't have testes yet, but I do think the current version (on master) is stable enough to be released into dist.ipfs.io. I tested it on Linux (Mint) and Windows and both versions worked fine. @diasdavid tried on macOS.

Despite not having the automatic builds, we can build the packages for each platform and release the first version (@victorbjelkholm, what happened to Jenkins? It's not building the new versions).

@nothingismagick
Copy link

Don’t know if this is stale (yet), but just saw this great recipe on the quasar discord server:

Gitlab CI awesomeness with docker magick

deploy-windows-64:
  stage: deploy
  image: electronuserland/builder:wine
  environment: production-windows-64
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - npm run pack:win64
  artifacts:
    paths:
      - dist/*.exe
      - dist/*.zip
  only:
    - master

deploy-windows-32:
  stage: deploy
  image: electronuserland/builder:wine
  environment: production-windows-32
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - npm run pack:win32
  artifacts:
    paths:
      - dist/*.exe
      - dist/*.zip
  only:
    - master

deploy-linux-64:
  stage: deploy
  image: electronuserland/builder
  environment: production-linux-64
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - npm run pack:linux64
  artifacts:
    paths:
      - dist/*.AppImage
  only:
    - master

deploy-linux-32:
  stage: deploy
  image: electronuserland/builder
  environment: production-linux-32
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - npm run pack:linux32
  artifacts:
    paths:
      - dist/*.AppImage
  only:
    - master

deploy-spa:
  stage: deploy
  image: node:alpine
  environment: production-spa
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - quasar build
  artifacts:
    paths:
      - dist/spa-mat/*
  only:
    - master

deploy-pwa:
  stage: deploy
  image: node:alpine
  environment: production-pwa
  script:
    - npm install --silent --global quasar-cli
    - npm install --silent
    - npm prune
    - quasar build --mode pwa
  artifacts:
    paths:
      - dist/pwa-mat/*
  only:
    - master

this is an excerpt of a package.json where we can use electron-builder to package a Quasar Electron app in a distributable format:

"scripts": {
    // (...)
    "prepack:linux64": "quasar build --mode electron --target linux --arch x64",
    "prepack:linux32": "quasar build --mode electron --target linux --arch ia32",
    "prepack:win64": "quasar build --mode electron --target win32 --arch x64",
    "prepack:win32": "quasar build --mode electron --target win32 --arch ia32",
    "pack:linux64": "electron-builder --linux --x64 --prepackaged ./dist/electron-mat/my-app-linux-x64/",
    "pack:linux32": "electron-builder --linux --ia32 --prepackaged ./dist/electron-mat/my-app-linux-ia32/",
    "pack:win64": "electron-builder --win --x64 --prepackaged ./dist/electron-mat/my-app-win32-x64/",
    "pack:win32": "electron-builder --win --ia32 --prepackaged ./dist/electron-mat/my-app-win32-ia32/"
  }

@hacdias
Copy link
Member

hacdias commented Nov 14, 2018

We do this already! 😄

@hacdias hacdias closed this as completed Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants