Skip to main content

Interface: RemoteBuildOptions

Configuration for a remote snap build on Launchpad. Remote builds run on Canonical's infrastructure without requiring native hardware or nested virtualisation.

A single remote build can target one or more architectures. Set buildFor to a string for one arch, or to an array (e.g. ["amd64", "arm64"]) to build several architectures in a single snapcraft remote-build job on Launchpad that emits a separate snap artifact per arch. Alternatively, the top-level arch option (e.g. arch: ["x64", "arm64"]) spawns a separate remote-build job per architecture — do not combine that with a buildFor array (mutually exclusive).

Authentication is resolved in this order:

  1. cscLink config field — base64-encoded credentials or a file path
  2. SNAP_CSC_LINK environment variable — same format as cscLink (CI-recommended; follows the same pattern as WIN_CSC_LINK for Windows code signing)
  3. SNAPCRAFT_STORE_CREDENTIALS environment variable (read directly by snapcraft)
  4. An active interactive snapcraft login session

CI setup (set once as a CI secret):

export SNAP_CSC_LINK=$(snapcraft export-login - | base64 -w0)

The resolved credentials are injected only into the spawned snapcraft subprocess environment and never exposed through process.env.

Properties​

acceptPublicUpload?​

optional acceptPublicUpload?: boolean

Suppress the Launchpad public-upload consent prompt by automatically accepting it. Your source code will be uploaded to a public Launchpad repository. Set to true in CI once you understand the implications.


buildFor?​

optional buildFor?: string | string[]

Target architecture (or architectures) for the remote build.

  • Single string (e.g. "amd64"): one Launchpad job, one output snap.
  • Array (e.g. ["amd64", "arm64"]): one Launchpad job that builds all listed architectures and downloads each resulting snap. All produced snaps are emitted as separate build artifacts.

Using an array here is mutually exclusive with setting arch: ["x64", "arm64"] at the electron-builder top level — the top-level arch option spawns a separate remote-build job per architecture, which would duplicate work.

Examples​

"amd64"
["amd64", "arm64"]

enabled​

enabled: boolean

Whether to enable remote build on Launchpad. Must be set explicitly to true to opt in.


launchpadUsername?​

optional launchpadUsername?: string

Your Launchpad username. Used to select the correct Launchpad account when more than one set of credentials is available.


privateProject?​

optional privateProject?: string

Launchpad project name to use for a private source upload. The project must already exist and you must have write access.


recover?​

optional recover?: boolean

Resume a previously interrupted remote build rather than starting a new one.


strategy?​

optional strategy?: "disable-fallback" | "force-fallback"

Controls whether snapcraft may fall back to a different remote build strategy.

  • "disable-fallback" — always use the primary strategy, fail if unavailable.
  • "force-fallback" — always use the fallback strategy.

timeout?​

optional timeout?: number

Maximum time in seconds to wait for the remote build to complete before aborting. Passed to snapcraft remote-build as --timeout <seconds>.

Example​

1800 // 30 minutes