question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split build and package steps

See original GitHub issue
  • Version: 20.2.0
  • Target: OSX (“dmg”, “zip”), Windows (“squirrel”, “nsis”), Linux (“deb”, “AppImage”)

This is more a question than an issue… We’re using electron-builder to build and package our app. We call electron-builder from a gulp task like this:

  builder.build({
    targets: builder.Platform.MAC.createTarget(["dmg", "zip"]),
    config
  });

We want to split building and packaging into two distinct steps so that we can sign the built files in a separate step that occurs externally. Is this possible in the current API? It might look something like this:

Step 1: Build
  // Output of this step is the unpacked folder (contains unsigned binaries)
  builder.build({
    config
  });
Step 2: Sign
Upload files to Signing Service. We get them back at some point in the future.
Step 3: Package
  // Input to this step is the unpacked folder (or in our case, a copy of it containing the now-signed binaries)
  // Output of this step is the packaged app (dmg, zip, etc.)
  builder.package({
    targets: builder.Platform.MAC.createTarget(["dmg", "zip"]),
    config
  });

I’m perusing the documentation and sources to see how it can be accomplished, but thought I’d ask here too.

Thank you.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
eanders-mscommented, Mar 23, 2018

This was pretty simple, it turns out. Here’s my solution in case it benefits others.

Step 1: Build
  // Build the 'dir' target for the platform
  builder.build({
    targets: builder.Platform.MAC.createTarget(["dir"]),
    config
  });
Step 3: Package
  // This time, specify the redistributable formats you want built (dmg and zip in this case).
  // Additional argument: 'prepackaged'. Set to the 'dir' target's output folder from Step 1.
  builder.build({
    targets: builder.Platform.MAC.createTarget(["dmg", "zip"]),
    config,
    prepackaged: 'path/to/dir/output'
  });
0reactions
develarcommented, Apr 28, 2018

@eanders-MS

Is this possible to do with what’s available today?

Yes. External code signing is supported for Windows — https://www.electron.build/configuration/win

sign String | (configuration: CustomWindowsSignTaskConfiguration) => Promise - The custom function (or path to file or module id) to sign Windows executable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I split maven compilation / package and test into two ...
The build server can easily setup a build/publish step by skipping the tests and I'd like to run a testing only test that...
Read more >
Separating Build and Release Pipelines for Effective DevOps
Reuse — Reuse specific steps in a complex pipeline, e.g., ... One such pattern is to split the Build and Release into separate...
Read more >
Splitting package / Creating & Modifying ... - Arch Linux Forums
Hello,. I'm maintaining the following package: https://aur.archlinux.org/pkgbase/gridcoinresearch/ Which builds 2 separate packages: ...
Read more >
A guide to test splitting - CircleCI
Each node is its own separate container, so each one will need to spin up, check out the code, and perform any steps...
Read more >
Split up the CI/CD Pipeline into two Pipelines
This post shows how to split up the existing CI/CD pipeline into a CI and a ... Build and push Docker image and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found