Skip to content

Commit

Permalink
build: add workflow for Flatpak
Browse files Browse the repository at this point in the history
This makes sure that changes are also verified by the Flatpak build.

- added Flatpak build manifest
  * copied .yml from

   https://github.com/flathub/io.github.bkueng.qMasterPassword

  * change source from "tar" to "dir" to build the current source tree
- add Flatpak bundle copied out from act-cli container to .gitignore
- add matrix workflow for Flatpak build
  * based on the official Flatpak Builder GitHub action with artifact
    upload disabled
  * add Flatpak bundle as GitHub build artifact
  * build can be disabled with

   $ act ... --matrix flatpak:no ...
  • Loading branch information
stefanb2 committed Feb 25, 2024
1 parent 02fe0f6 commit 1a5dfb0
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build-flatpak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: build-flatpak

on:
workflow_call:

jobs:
build-linux:
name: Build Flatpak
runs-on: ubuntu-latest

strategy:
matrix:
flatpak: [yes]
fail-fast: false

container:
image: bilelmoussaoui/flatpak-github-actions:kde-5.15-23.08
options: --privileged

steps:
- name: Install additional packages
run: >
dnf install --setopt=install_weak_deps=False -y
nodejs
- name: Checkout
uses: actions/checkout@v4

- name: Build
# NOTE: this git commit adds support for "upload-artifact: false"
# @TODO - replace with tag once included in a release
uses: flatpak/flatpak-github-actions/flatpak-builder@b8be6bc0ede43cb3a2cc55895654312b14f84a0d
with:
bundle: io.github.bkueng.qMasterPassword
manifest-path: ./data/flatpak/io.github.bkueng.qMasterPassword.yml
cache-key: flatpak-builder-${{ github.sha }}
upload-artifact: false
verbose: true

- name: Upload Flatpak
uses: actions/upload-artifact@v4
with:
name: flatpak
path: io.github.bkueng.qMasterPassword
# skip step when running under act-cli
if: |
env.ACT != 'true'
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
matrix-precommit:
uses: ./.github/workflows/pre-commit.yml

matrix-flatpak:
uses: ./.github/workflows/build-flatpak.yml

matrix-linux:
uses: ./.github/workflows/build-linux.yml

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

/windows_build

# flatpak bundle copied out from act-cli container for testing
# flatpak --user install --bundle ./io.github.bkueng.qMasterPassword
/io.github.bkueng.qMasterPassword

*.log

/.cproject
Expand Down
34 changes: 34 additions & 0 deletions data/flatpak/io.github.bkueng.qMasterPassword.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
id: io.github.bkueng.qMasterPassword
runtime: org.kde.Platform
runtime-version: '5.15-23.08'
sdk: org.kde.Sdk
command: qMasterPassword
rename-icon: qmasterpassword
rename-desktop-file: qMasterPassword.desktop
rename-appdata-file: qMasterPassword.appdata.xml
finish-args:
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
- --device=dri
- --talk-name=org.kde.StatusNotifierWatcher
modules:
- name: libscrypt
buildsystem: autotools
no-autogen: true
make-install-args:
- PREFIX=/app
sources:
- type: archive
url: https://github.com/technion/libscrypt/archive/v1.22.tar.gz
sha256: a2d30ea16e6d288772791de68be56153965fe4fd4bcd787777618b8048708936
- name: qMasterPassword
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
- -DDISABLE_FILL_FORM_SHORTCUTS=ON
post-install:
- install -Dm644 /app/share/pixmaps/qmasterpassword.png -t /app/share/icons/hicolor/512x512/apps
sources:
- type: dir
path: ../../

0 comments on commit 1a5dfb0

Please sign in to comment.