From fd29b40591e892ed6ed1a31f1f5d715499c6277d Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 24 Feb 2024 17:49:12 +0200 Subject: [PATCH 1/6] restore .editorconfig This partially revertsi commit 39227b81df9a3d4dddbd78b16afb53920458657f This makes sure that editors format file content already in the format that won't be rejected by clang-format later. --- .editorconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aa25cac --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.ui] +indent_size = 1 + +[*.{yml,appdata.xml}] +indent_size = 2 From 9d90812d1010096f993ccf337c444ec7170b8865 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 24 Feb 2024 18:08:13 +0200 Subject: [PATCH 2/6] build: update action versions --- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-windows.yml | 4 ++-- .github/workflows/pre-commit.yml | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d11e939..e723194 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -186,7 +186,7 @@ jobs: matrix.appimage - name: Upload AppImage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: appimage-qt${{ matrix.qt }} path: ${{ runner.temp }}/linuxdeploy/qMasterPassword-x86_64.AppImage diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index b82fba8..622835f 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -21,7 +21,7 @@ jobs: submodules: true - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64 @@ -66,7 +66,7 @@ jobs: cmake --build ${{ runner.temp }}/build --config Release --target makensis - name: Upload installer package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: windows-installer path: ${{ runner.temp }}/nsis/qMasterPassword.exe diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ec4d9b3..e0c41f1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,6 +9,8 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - uses: pre-commit/action@v3.0.1 From cf8216dd50b41bd36d9d55b8f6d8fc64d0e7d9b3 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 24 Feb 2024 18:15:37 +0200 Subject: [PATCH 3/6] build: add Fedora 40 Fedora 40 has been branched off from Rawhide a short while ago. --- .github/workflows/build-linux.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e723194..26cb1fa 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -17,6 +17,7 @@ jobs: - debian:testing - fedora:38 - fedora:39 + - fedora:40 - fedora:rawhide - ubuntu:latest - ubuntu:rolling @@ -31,6 +32,8 @@ jobs: - container: fedora:38 qt: 6 appimage: true + - container: fedora:40 + no_x11: true - container: fedora:rawhide no_x11: true From 02fe0f6373f594eb252fb694aa6c04b3b1c9defe Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 24 Feb 2024 18:51:58 +0200 Subject: [PATCH 4/6] build: convert pre-commit to matrix It is annoying that this build was always triggered when you were trying to test another build locally. Now it can be disabled with $ act ... --matrix pre-commit:no ... --- .github/workflows/build.yml | 3 +++ .github/workflows/pre-commit.yml | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7330098..073b096 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,9 @@ on: - cron: '16 3 10 * *' jobs: + matrix-precommit: + uses: ./.github/workflows/pre-commit.yml + matrix-linux: uses: ./.github/workflows/build-linux.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e0c41f1..e0f4abd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,13 +1,17 @@ name: pre-commit on: - pull_request: - push: - branches: [main] + workflow_call: jobs: pre-commit: + name: Run pre-commit checks runs-on: ubuntu-latest + + strategy: + matrix: + pre-commit: [yes] + fail-fast: false steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 1a5dfb093f875ad19f05004f15d62289707140c0 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 25 Feb 2024 12:37:21 +0200 Subject: [PATCH 5/6] build: add workflow for Flatpak 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 ... --- .github/workflows/build-flatpak.yml | 48 +++++++++++++++++++ .github/workflows/build.yml | 3 ++ .gitignore | 4 ++ .../io.github.bkueng.qMasterPassword.yml | 34 +++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 .github/workflows/build-flatpak.yml create mode 100644 data/flatpak/io.github.bkueng.qMasterPassword.yml diff --git a/.github/workflows/build-flatpak.yml b/.github/workflows/build-flatpak.yml new file mode 100644 index 0000000..d5bb4aa --- /dev/null +++ b/.github/workflows/build-flatpak.yml @@ -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' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 073b096..1555c00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.gitignore b/.gitignore index 7ca4283..b00d5d1 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/data/flatpak/io.github.bkueng.qMasterPassword.yml b/data/flatpak/io.github.bkueng.qMasterPassword.yml new file mode 100644 index 0000000..baf44ef --- /dev/null +++ b/data/flatpak/io.github.bkueng.qMasterPassword.yml @@ -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: ../../ From 21a96a903b35937af7b4803fc76dfa0457d3ab1d Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sun, 25 Feb 2024 15:04:42 +0200 Subject: [PATCH 6/6] build: disable flatpak caching The workflow is not an official release build, hence nothing should be cached. That was the reason why it was so slow, because it uploaded stuff to the cache after the artifacts had been generated. --- .github/workflows/build-flatpak.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-flatpak.yml b/.github/workflows/build-flatpak.yml index d5bb4aa..a5c013a 100644 --- a/.github/workflows/build-flatpak.yml +++ b/.github/workflows/build-flatpak.yml @@ -34,7 +34,9 @@ jobs: with: bundle: io.github.bkueng.qMasterPassword manifest-path: ./data/flatpak/io.github.bkueng.qMasterPassword.yml - cache-key: flatpak-builder-${{ github.sha }} + # NOTE: this is not an official build hence nothing should be cached + cache: false + #cache-key: flatpak-builder-${{ github.sha }} upload-artifact: false verbose: true