Support signing Flatpak builds with GPG

This honors the following environment variables:

- $GPG_KEY_ID: When set, it can be the identifier, full fingerprint, or
  email address of a GnuPG key which will be used to sign Flatpak builds.

- $GPG_HOMEDIR: Path to an alternative home directory to be used by GnuPG,
  instead of the default ~/.gnupg directory of the current user. This can
  be used to point GnuPG to a different keychain.
This commit is contained in:
Adrian Perez de Castro
2016-11-28 15:25:04 +02:00
parent 32222e2eef
commit deb4e410c7

View File

@@ -217,6 +217,13 @@ function buildFlatpak(arch) {
arch: flatpakArch,
bundlePath: manifest.appId + '-' + flatpakArch + '.flatpak',
};
// Setup PGP signing if requested.
if (process.env.GPG_KEY_ID !== undefined) {
buildOptions.gpgSign = process.env.GPG_KEY_ID;
if (process.env.GPG_HOMEDIR) {
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
}
}
return function (cb) {
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
}