Skip to content

Commit

Permalink
[PM-14850] Flatpak development & qa artifacts (#11925)
Browse files Browse the repository at this point in the history
* Add flatpak development manifest

* Undo removal of libsecret

* Update .github/workflows/build-desktop.yml

Co-authored-by: Vince Grassia <[email protected]>

---------

Co-authored-by: Vince Grassia <[email protected]>
  • Loading branch information
quexten and vgrassia authored Nov 13, 2024
1 parent 0b11596 commit a75c211
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- name: Set up environment
run: |
sudo apt-get update
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm musl-dev musl-tools
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm musl-dev musl-tools flatpak flatpak-builder
- name: Set up Snap
run: sudo snap install snapcraft --classic
Expand Down Expand Up @@ -248,6 +248,19 @@ jobs:
name: ${{ needs.setup.outputs.release_channel }}-linux.yml
path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-linux.yml
if-no-files-found: error

- name: Build flatpak
working-directory: apps/desktop
run: |
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo npm run pack:lin:flatpak
- name: Upload flatpak artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: com.bitwarden.desktop.flatpak
path: apps/desktop/dist/com.bitwarden.desktop.flatpak
if-no-files-found: error


windows:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ npm-debug.log
dist
build
.angular/cache
.flatpak
.flatpak-repo
.flatpak-builder

# Testing
coverage
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"electron:ignore": "node ./scripts/start.js --ignore-certificate-errors",
"clean:dist": "rimraf ./dist",
"pack:dir": "npm run clean:dist && electron-builder --dir -p never",
"pack:lin:flatpak": "npm run clean:dist && electron-builder --dir -p never && flatpak-builder --repo=build/.repo build/.flatpak ./resources/com.bitwarden.desktop.devel.yaml --install-deps-from=flathub --force-clean && flatpak build-bundle ./build/.repo/ ./dist/com.bitwarden.desktop.flatpak com.bitwarden.desktop",
"pack:lin": "npm run clean:dist && electron-builder --linux --x64 -p never",
"pack:mac": "npm run clean:dist && electron-builder --mac --universal -p never",
"pack:mac:arm64": "npm run clean:dist && electron-builder --mac --arm64 -p never",
Expand Down
43 changes: 43 additions & 0 deletions apps/desktop/resources/com.bitwarden.desktop.devel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
app-id: com.bitwarden.desktop
runtime: org.freedesktop.Platform
runtime-version: "24.08"
sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp
base-version: "24.08"
command: bitwarden.sh
finish-args:
- --share=ipc
- --share=network
- --socket=wayland
- --socket=x11
- --device=dri
- --env=XDG_CURRENT_DESKTOP=Unity
- --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons
- --talk-name=org.kde.StatusNotifierWatcher
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.secrets
- --talk-name=com.canonical.AppMenu.Registrar
- --system-talk-name=org.freedesktop.PolicyKit1
# Lock on lockscreen
- --talk-name=org.gnome.ScreenSaver
- --talk-name=org.freedesktop.ScreenSaver
- --system-talk-name=org.freedesktop.login1
- --filesystem=xdg-download
modules:
- name: bitwarden-desktop
buildsystem: simple
build-commands:
- mkdir -p /app/bin
- mkdir -p /app/bin/Bitwarden/
- cp -r ./* /app/bin/
- install bitwarden.sh /app/bin/bitwarden.sh
sources:
- type: dir
path: ../dist/linux-unpacked
- type: script
dest-filename: bitwarden.sh
commands:
- ulimit -c 0
- export TMPDIR="$XDG_RUNTIME_DIR/app/$FLATPAK_ID"
- exec zypak-wrapper /app/bin/bitwarden-app --ozone-platform-hint=auto
--enable-features=WaylandWindowDecorations "$@"

0 comments on commit a75c211

Please sign in to comment.