From deb4e410c755b12b942117beaa9e1f92ed2bb3e8 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 28 Nov 2016 15:25:04 +0200 Subject: [PATCH 1/3] 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. --- build/gulpfile.vscode.linux.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index daa703eecda00..9b694d2ae53e1 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -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); } From 86f5213f3922662f9d0fc3f55a5ab08f10471cd5 Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 28 Nov 2016 15:59:59 +0200 Subject: [PATCH 2/3] Flatpak: Allow specifying the path to a destination repository This makes the Flatpak builds honor the $FLATPAK_REPO environment variable. When it is defined, it will be used as the path to an OSTree repository where the Flatpak application bundle will be committed to. This allows to place multiple builds in the same repository (along other applications, even), which can be published. For more details abuit using repositories for publishing, check: http://flatpak.org/developer.html#Distributing_Applications Note that setting $FLATPAK_REPO disables building a standalone .flatpak bundle file. --- build/gulpfile.vscode.linux.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 9b694d2ae53e1..87e2580bc3781 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -215,8 +215,13 @@ function buildFlatpak(arch) { ]; const buildOptions = { arch: flatpakArch, - bundlePath: manifest.appId + '-' + flatpakArch + '.flatpak', }; + // If requested, use the configured path for the OSTree repository. + if (process.env.FLATPAK_REPO) { + buildOptions.repoDir = process.env.FLATPAK_REPO; + } else { + buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak'; + } // Setup PGP signing if requested. if (process.env.GPG_KEY_ID !== undefined) { buildOptions.gpgSign = process.env.GPG_KEY_ID; From 464cffc766b636e103f1a766c225b1935e15548c Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 28 Nov 2016 16:44:57 +0200 Subject: [PATCH 3/3] Flatpak: Set the subject used for repository commits When storing the output of a Flatpak build to a commit into an OSTree repository (by setting the $FLATPAK_REPO environment variable), it is good to have a descriptive subject in the commit log message. --- build/gulpfile.vscode.linux.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 87e2580bc3781..586bedbc388d7 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -215,6 +215,7 @@ function buildFlatpak(arch) { ]; const buildOptions = { arch: flatpakArch, + subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision, }; // If requested, use the configured path for the OSTree repository. if (process.env.FLATPAK_REPO) {