From 1587a78a75f4577f73953d6ba4151c7adf0c087d Mon Sep 17 00:00:00 2001 From: soumyadghosh Date: Mon, 19 Feb 2024 23:17:16 +0530 Subject: [PATCH 1/2] Various snap related changes 1. Updated the `quick-add` command when using as a snap 2. Updated gitignore to ignore snap related files 3. Updated README with snap release --- .gitignore | 3 ++- README.md | 4 ++++ src/Dialogs/Preferences/PreferencesWindow.vala | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 05abb2779..1ba5e498c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ build-aux/.flatpak-builder build-aux/io.github.alainm23.planify.Devel.flatpak .flatpak-builder/ subprojects/gxml - +*.snap +planify*txt diff --git a/README.md b/README.md index 37c577b82..bf862cfe6 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Download on Flathub + + Get it from the Snap Store + + ## 🛠 Compile You'll need the following dependencies: diff --git a/src/Dialogs/Preferences/PreferencesWindow.vala b/src/Dialogs/Preferences/PreferencesWindow.vala index 1b18f0c9c..165149027 100644 --- a/src/Dialogs/Preferences/PreferencesWindow.vala +++ b/src/Dialogs/Preferences/PreferencesWindow.vala @@ -1059,7 +1059,7 @@ public class Dialogs.Preferences.PreferencesWindow : Adw.PreferencesWindow { private Adw.NavigationPage get_quick_add_page () { var settings_header = new Dialogs.Preferences.SettingsHeader (_("Quick Add")); - string quick_add_command = "flatpak run --command=io.github.alainm23.planify.quick-add %s".printf (Build.APPLICATION_ID); + string quick_add_command = GLib.Environment.get_variable("SNAP") != "" ? "planify.quick-add" : "flatpak run --command=io.github.alainm23.planify.quick-add %s".printf (Build.APPLICATION_ID); var description_label = new Gtk.Label ( _("Use Quick Add to create to-dos from anywhere on your desktop with just a few keystrokes. You don’t even have to leave the app you’re currently in.") // vala-lint=line-length From 308504c04d561b8473606806923b3113e25b8dc9 Mon Sep 17 00:00:00 2001 From: soumyadghosh Date: Mon, 19 Feb 2024 23:22:32 +0530 Subject: [PATCH 2/2] added workflow to test the snap --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45b989a2d..9289e237d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,3 +31,18 @@ jobs: cache-key: flatpak-builder-${{ github.sha }} repository-name: flathub-beta repository-url: https://flathub.org/beta-repo/flathub-beta.flatpakrepo # until GNOME 45 + snap: + name: "Snap" + runs-on: ubuntu-latest + steps: + - name: Checkout Git repository + uses: actions/checkout@v4 + - name: Build Snap + uses: snapcore/action-build@v1 + id: snapcraft-build + with: + snapcraft-args: "--verbosity debug" + - uses: actions/upload-artifact@v4 + with: + name: planify_amd64_snap + path: ${{ steps.snapcraft-build.outputs.snap }}