-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(maker): add the flatpak maker for the linux target
- Loading branch information
Showing
8 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
src | ||
test | ||
.travis.yml | ||
ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM malept/electron-forge-container:latest | ||
|
||
RUN mkdir /code | ||
WORKDIR /code | ||
ADD . /code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
NODE_INSTALLER="$1" | ||
|
||
if [[ "$NODE_INSTALLER" = "yarn" ]]; then npm i -g yarn; fi | ||
npm run test -- --installer=$NODE_INSTALLER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then | ||
sudo docker build -f ci/Dockerfile . -t electron-forge-ci | ||
sudo docker run -it electron-forge-ci ci/docker.sh $NODE_INSTALLER | ||
else | ||
if [[ "$NODE_INSTALLER" = "yarn" ]]; then npm i -g yarn; fi | ||
npm run test -- --installer=$NODE_INSTALLER | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import installer from 'electron-installer-flatpak'; | ||
import path from 'path'; | ||
import pify from 'pify'; | ||
|
||
import { ensureFile } from '../../util/ensure-output'; | ||
|
||
function flatpakArch(nodeArch) { | ||
switch (nodeArch) { | ||
case 'ia32': return 'i386'; | ||
case 'x64': return 'x86_64'; | ||
// arm => arm | ||
default: return nodeArch; | ||
} | ||
} | ||
|
||
export default async (dir, appName, forgeConfig, packageJSON) => { // eslint-disable-line | ||
const arch = flatpakArch(process.arch); | ||
const outPath = path.resolve(dir, '../make', `${packageJSON.name}_${packageJSON.version}_${arch}.flatpak`); | ||
|
||
await ensureFile(outPath); | ||
const flatpakDefaults = { | ||
arch, | ||
dest: path.dirname(outPath), | ||
src: dir, | ||
}; | ||
const flatpakConfig = Object.assign({}, forgeConfig.electronInstallerFlatpak, flatpakDefaults); | ||
|
||
await pify(installer)(flatpakConfig); | ||
}; |