mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 09:37:22 +00:00
feat: add flatpak application
Change-Id: I4c6dce9eacbd81855fefb314baecb7213b7fcc56 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
parent
21fc9b4f5c
commit
037518067a
6 changed files with 72 additions and 5 deletions
|
|
@ -45,9 +45,33 @@ const config = {
|
|||
win: {
|
||||
target: ['portable', 'nsis'],
|
||||
},
|
||||
|
||||
flatpak: {
|
||||
license: 'LICENSE',
|
||||
finishArgs: [
|
||||
// allow to execute commands remotely
|
||||
'--socket=session-bus',
|
||||
'--socket=wayland',
|
||||
'--socket=x11',
|
||||
'--share=ipc',
|
||||
// Open GL
|
||||
'--device=dri',
|
||||
// Read/write home directory access
|
||||
'--filesystem=home',
|
||||
// Read podman socket
|
||||
'--filesystem=xdg-run/podman',
|
||||
// Allow communication with network
|
||||
'--share=network',
|
||||
// System notifications with libnotify
|
||||
'--talk-name=org.freedesktop.Notifications',
|
||||
],
|
||||
useWaylandFlags: 'true',
|
||||
artifactName: 'podman-desktop-${version}.${ext}',
|
||||
runtimeVersion: '21.08',
|
||||
branch: 'main',
|
||||
},
|
||||
linux: {
|
||||
target: ['tar.gz'],
|
||||
icon: './buildResources/icon-512x512.png',
|
||||
target: ['flatpak', 'tar.gz'],
|
||||
},
|
||||
afterSign: 'electron-builder-notarize',
|
||||
mac: {
|
||||
|
|
|
|||
9
.github/workflows/next-build.yaml
vendored
9
.github/workflows/next-build.yaml
vendored
|
|
@ -105,6 +105,15 @@ jobs:
|
|||
run: |
|
||||
yarn --frozen-lockfile --network-timeout 180000
|
||||
|
||||
- name: Install flatpak on Linux
|
||||
if: ${{ matrix.os=='ubuntu-20.04' }}
|
||||
run: |
|
||||
sudo apt-get install flatpak -y
|
||||
sudo apt-get install flatpak-builder -y
|
||||
sudo apt-get install elfutils -y
|
||||
flatpak remote-add --if-not-exists flathub --user https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install flathub --user -y org.freedesktop.Platform/x86_64/21.08
|
||||
|
||||
- name: Set macOS environment variables
|
||||
if: ${{ matrix.os=='macos-11' }}
|
||||
run: |
|
||||
|
|
|
|||
13
.github/workflows/pr-check.yaml
vendored
13
.github/workflows/pr-check.yaml
vendored
|
|
@ -90,6 +90,14 @@ jobs:
|
|||
- name: Execute yarn
|
||||
run: yarn --frozen-lockfile --network-timeout 180000
|
||||
|
||||
- name: Install flatpak
|
||||
run: |
|
||||
sudo apt-get install flatpak -y
|
||||
sudo apt-get install flatpak-builder -y
|
||||
sudo apt-get install elfutils -y
|
||||
flatpak remote-add --if-not-exists flathub --user https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install flathub --user -y org.freedesktop.Platform/x86_64/21.08
|
||||
|
||||
- name: Run Build
|
||||
timeout-minutes: 20
|
||||
run: yarn compile:pull-request
|
||||
|
|
@ -102,6 +110,11 @@ jobs:
|
|||
name: linux
|
||||
path: ./dist/podman-desktop-*.tar.gz
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: flatpak
|
||||
path: ./dist/podman-desktop-*.flatpak
|
||||
|
||||
darwin:
|
||||
name: macOS
|
||||
runs-on: macos-11
|
||||
|
|
|
|||
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
|
|
@ -103,6 +103,15 @@ jobs:
|
|||
run: |
|
||||
yarn --frozen-lockfile --network-timeout 180000
|
||||
|
||||
- name: Install flatpak on Linux
|
||||
if: ${{ matrix.os=='ubuntu-20.04' }}
|
||||
run: |
|
||||
sudo apt-get install flatpak -y
|
||||
sudo apt-get install flatpak-builder -y
|
||||
sudo apt-get install elfutils -y
|
||||
flatpak remote-add --if-not-exists flathub --user https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install flathub --user -y org.freedesktop.Platform/x86_64/21.08
|
||||
|
||||
- name: Set macOS environment variables
|
||||
if: ${{ matrix.os=='macos-11' }}
|
||||
run: |
|
||||
|
|
|
|||
BIN
buildResources/icon-512x512.png
Normal file
BIN
buildResources/icon-512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
|
|
@ -210,11 +210,15 @@ async function registerProviderFor(provider: extensionApi.Provider, machineInfo:
|
|||
storedExtensionContext.subscriptions.push(disposable);
|
||||
}
|
||||
|
||||
function execPromise(command, args?: string[], logger?: extensionApi.Logger): Promise<string> {
|
||||
function execPromise(command: string, args?: string[], logger?: extensionApi.Logger): Promise<string> {
|
||||
const env = process.env;
|
||||
// In production mode, applications don't have access to the 'user' path like brew
|
||||
if (isMac) {
|
||||
env.PATH = env.PATH.concat(':/usr/local/bin').concat(':/opt/homebrew/bin');
|
||||
} else if (env.FLATPAK_ID) {
|
||||
// need to execute the command on the host
|
||||
args = ['--host', command, ...args];
|
||||
command = 'flatpak-spawn';
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
let output = '';
|
||||
|
|
@ -294,10 +298,18 @@ export async function activate(extensionContext: extensionApi.ExtensionContext):
|
|||
monitorMachines(provider);
|
||||
} else if (isLinux) {
|
||||
// on Linux, need to run the system service for unlimited time
|
||||
const process = spawn('podman', ['system', 'service', '--time=0']);
|
||||
let command = 'podman';
|
||||
let args = ['system', 'service', '--time=0'];
|
||||
const env = process.env;
|
||||
if (env.FLATPAK_ID) {
|
||||
// need to execute the command on the host
|
||||
command = 'flatpak-spawn';
|
||||
args = ['--host', 'podman', ...args];
|
||||
}
|
||||
const podmanProcess = spawn(command, args);
|
||||
await timeout(500);
|
||||
const disposable = extensionApi.Disposable.create(() => {
|
||||
process.kill();
|
||||
podmanProcess.kill();
|
||||
});
|
||||
extensionContext.subscriptions.push(disposable);
|
||||
initDefaultLinux(provider);
|
||||
|
|
|
|||
Loading…
Reference in a new issue