DEV Community

Cover image for Super fast Electron builds with CircleCI πŸš€
kontrollanten
kontrollanten

Posted on β€’ Edited on

7 5

Super fast Electron builds with CircleCI πŸš€

Recently I switched from Travis to CircleCI, since I had some problems with getting my Travis stages working accurate. The results was overwhelming.

Simple Docker configuration

Since CircleCI jobs can run in Docker containers, it's get really simple to configure electron-builder multi build:

# Travis
script:
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      docker run --rm \
        --env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
        -v ${PWD}:/project \
        -v ~/.cache/electron:/root/.cache/electron \
        -v ~/.cache/electron-builder:/root/.cache/electron-builder \
        electronuserland/builder:wine \
        /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn release --linux --win"
     fi

# CircleCI
deploy-linux:
  docker:
    - image: electronuserland/builder:wine
  steps:
    - run: yarn --link-duplicates --pure-lockfile
    - run: yarn release --linux --win

The Circle config is much easier to read and maintain, since everything is based on Docker you don't need to pass environment variables you want to use in the container.

Almighty debug support

With Docker you can always run the jobs with the same environment locally, which makes everything easier to debug. If that's not enough, you can always SSH into the build container.

Super fast

For 4 minutes after a push commit I've the response from

  • Linting
  • React unit testing
  • Electron unit testing
  • Spectron e2e testing

Ten minutes later I'll also have Linux and MacOS builds deployed and ready to download. No more queues (at least yet) and no more waiting. Since a CI environment is supposed to support me as a developer I think it's vital that the feedback is quick and that I never have to wait for over 5-10 minutes until I have the response. A big plus is that I don't have to see the pride flag in my builds any more. πŸ₯³

To see my whole Circle config, you can check here.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay