Skip to content

build: configure a flatpak - #285

Merged
vitonsky merged 8 commits into
masterfrom
284-publish-on-flathub
May 4, 2026
Merged

build: configure a flatpak#285
vitonsky merged 8 commits into
masterfrom
284-publish-on-flathub

Conversation

@vitonsky

@vitonsky vitonsky commented May 4, 2026

Copy link
Copy Markdown
Member

Closes #284

Summary by CodeRabbit

  • Chores
    • Added Flatpak packaging and AppStream metadata so the app can be distributed and discovered via Flathub on Linux desktops (includes desktop launcher, metadata, runtime configuration, packaging targets, and a small launcher wrapper).
    • Updated packaging ignore rules and build/bundle targets to produce an installable Flatpak.
    • Added a Flathub verification entry.
  • Chores
    • CI workflow now runs on all pull request event types instead of a restricted subset.

@vitonsky vitonsky linked an issue May 4, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds Flathub packaging (Flatpak manifest, AppStream metainfo, desktop entry, launcher, Makefile, .gitignore, verified-apps entry) for the Deepink desktop app and removes the pull_request.types filter so the site workflow runs on all pull_request event types.

Changes

Flathub Publication Setup

Layer / File(s) Summary
AppStream / Desktop Metadata
packages/app/scripts/flathub/app.deepink.Deepink.metainfo.xml, packages/app/scripts/flathub/app.deepink.Deepink.desktop
New AppStream metainfo and desktop entry with ID, license, marketing text, release record, Exec, Icon, categories, and startup settings.
Flatpak Manifest / Permissions
packages/app/scripts/flathub/app.deepink.Deepink.yaml
New Flatpak manifest: app-id, runtime/sdk, arch restriction, command, and finish-args (Wayland/X11 fallback, IPC, GPU, network, home FS) plus D-Bus --talk-name permissions for notifications and KDE integrations.
Module Install / Sources
packages/app/scripts/flathub/app.deepink.Deepink.yaml (modules section)
deepink module installs prebuilt Electron app into /app/lib/deepink, marks main binary executable, installs deepink.sh, icon, desktop entry, and metainfo; sources include pinned release ZIP, a pinned monorepo commit, and local deepink.sh.
Launcher Wrapper
packages/app/scripts/flathub/deepink.sh
New shell wrapper that execs /app/lib/deepink/deepink with --no-sandbox and --ozone-platform-hint=auto, forwarding arguments.
Build / Packaging Helpers
packages/app/scripts/flathub/Makefile, packages/app/scripts/flathub/.gitignore
Makefile targets to build/install/export/bundle the Flatpak and gitignore entries for build-dir, flatpak-repo, deepink.flatpak.
Repository Metadata
packages/site/public/.well-known/org.flathub.VerifiedApps.txt
Adds a verification line referencing a Flathub PR comment.

Workflow Trigger Configuration

Layer / File(s) Summary
CI Event Filter Removal
.github/workflows/site.yml
Removed pull_request.types: [opened, synchronize, reopened], so the pull_request trigger runs on all pull request event types.

Sequence Diagram(s)

sequenceDiagram
participant Dev as Developer/CI
participant Builder as flatpak-builder
participant Repo as Flatpak Repo (export)
participant Bundle as flatpak build-bundle
participant Flathub as Flathub

Dev->>Builder: run flatpak-builder with `app.deepink.Deepink.yaml`
Builder->>Repo: build-export repository (stable)
Repo->>Bundle: build-bundle -> `deepink.flatpak`
Bundle->>Flathub: upload/publish bundle
Flathub-->>Dev: serve app to users
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • build: setup build infrastructure #278 — Also modifies .github/workflows/site.yml pull_request trigger configuration.
  • Issue #284 — "Publish on flathub" (linked objective for adding Flathub packaging).

Poem

🐰 I hopped in code and found a trail,
Flatpaks, metas, icons on my tail,
I wrapped the bin and pinned the zip,
Built a bundle for a Flathub trip,
Deepink hops out — ready to sail!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The workflow file modification (.github/workflows/site.yml) that removes the pull_request trigger filter appears unrelated to Flathub publication and falls outside the stated objective of publishing on Flathub. Clarify the purpose of the workflow change or move it to a separate PR focused on CI/CD improvements rather than Flathub publishing.
Title check ⚠️ Warning The title 'build: configure a flatpak' is only partially related to the changeset. While the PR does configure Flatpak files, the primary objective from the linked issue is to publish the application on Flathub, which is not reflected in the title. Update the title to better reflect the main objective, such as 'build: configure flatpak for flathub publishing' or 'build: add flathub publishing configuration'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR adds necessary Flathub configuration files (metainfo.xml, desktop entry, Flatpak manifest, launcher script) and build infrastructure (Makefile, .gitignore) required to publish on Flathub [#284], fully addressing the linked issue objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 284-publish-on-flathub

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/app/scripts/flathub/app.deepink.Deepink.yaml`:
- Around line 64-65: The install command's source path is missing the extracted
archive root (Deepink-linux-x64) so it looks for /app/lib/deepink/resources/...
instead of /app/lib/deepink/Deepink-linux-x64/resources/.... Update the install
invocation that references "install -Dm644
/app/lib/deepink/resources/assets/icons/app.png ..." to include the intermediate
"Deepink-linux-x64" directory (i.e.
/app/lib/deepink/Deepink-linux-x64/resources/assets/icons/app.png), or
alternatively modify the earlier extraction step to strip the top-level
directory (use tar/bsdtar/unzip options in the build-commands) so files land
directly under /app/lib/deepink and the existing install path remains valid.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 589c6f16-1094-4f24-89c5-1e1c3465dd14

📥 Commits

Reviewing files that changed from the base of the PR and between 2755c26 and 36861de.

📒 Files selected for processing (5)
  • .github/workflows/site.yml
  • packages/app/scripts/flathub/app.deepink.Deepink.desktop
  • packages/app/scripts/flathub/app.deepink.Deepink.metainfo.xml
  • packages/app/scripts/flathub/app.deepink.Deepink.yaml
  • packages/app/scripts/flathub/deepink.sh
💤 Files with no reviewable changes (1)
  • .github/workflows/site.yml

Comment thread packages/app/scripts/flathub/app.deepink.Deepink.yaml
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Cloudflare Pages Deployment

Event Name: pull_request
Environment: preview
Project: deepink
Built with commit: e3e1a28
Preview URL: https://cc093d5b.deepink.pages.dev
Branch Preview URL: https://284-publish-on-flathub.deepink.pages.dev

Wrangler Output

⛅️ wrangler 4.87.0
───────────────────
Uploading... (161/201)
Uploading... (174/201)
Uploading... (188/201)
Uploading... (201/201)
✨ Success! Uploaded 40 files (161 already uploaded) (2.31 sec)

🌎 Deploying...
✨ Deployment complete! Take a peek over at https://cc093d5b.deepink.pages.dev
✨ Deployment alias URL: https://284-publish-on-flathub.deepink.pages.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/app/scripts/flathub/app.deepink.Deepink.yaml (1)

50-65: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix archive root handling before chmod/icon install.

Line 50 currently copies the ZIP contents in a way that preserves the top-level Deepink-linux-x64/ directory, but Lines 51 and 64 assume files were flattened. That can break the build (chmod/install source not found).

Suggested fix
-      - cp -r artifacts/app/* /app/lib/deepink
+      - cp -r artifacts/app/Deepink-linux-x64/* /app/lib/deepink
       - chmod +x /app/lib/deepink/deepink
...
       - install -Dm644 /app/lib/deepink/resources/assets/icons/app.png
         /app/share/icons/hicolor/256x256/apps/app.deepink.Deepink.png
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/app/scripts/flathub/app.deepink.Deepink.yaml` around lines 50 - 65,
The install steps assume the ZIP was extracted flat but the archive keeps a
top-level Deepink-linux-x64/ directory, so subsequent chmod/install paths
(targeting /app/lib/deepink/deepink and /app/lib/deepink/resources/...) fail;
update the copy step (the current "cp -r artifacts/app/* /app/lib/deepink") to
either copy the contents of the archive root into /app/lib/deepink (detect and
strip the single top-level directory) or adjust the chmod/install source paths
to include that top-level folder; ensure deepink binary (deepink) and
resources/assets/icons/app.png are referenced correctly after flattening, and
keep deepink.sh installation unchanged.
🧹 Nitpick comments (1)
packages/app/scripts/flathub/Makefile (1)

9-14: Declare install and clean targets as .PHONY.

These command-only targets should be declared as phony to prevent accidental no-op behavior if files or directories with these names are created.

Add the following line at the beginning of the Makefile:

.PHONY: install clean
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/app/scripts/flathub/Makefile` around lines 9 - 14, Add a .PHONY
declaration for the Makefile targets to mark them as phony; specifically add a
line declaring ".PHONY: install clean" near the top of the Makefile so the
"install" and "clean" targets (used by flatpak-builder and rm -rf) are always
executed regardless of files or directories named "install" or "clean".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/app/scripts/flathub/app.deepink.Deepink.yaml`:
- Around line 50-65: The install steps assume the ZIP was extracted flat but the
archive keeps a top-level Deepink-linux-x64/ directory, so subsequent
chmod/install paths (targeting /app/lib/deepink/deepink and
/app/lib/deepink/resources/...) fail; update the copy step (the current "cp -r
artifacts/app/* /app/lib/deepink") to either copy the contents of the archive
root into /app/lib/deepink (detect and strip the single top-level directory) or
adjust the chmod/install source paths to include that top-level folder; ensure
deepink binary (deepink) and resources/assets/icons/app.png are referenced
correctly after flattening, and keep deepink.sh installation unchanged.

---

Nitpick comments:
In `@packages/app/scripts/flathub/Makefile`:
- Around line 9-14: Add a .PHONY declaration for the Makefile targets to mark
them as phony; specifically add a line declaring ".PHONY: install clean" near
the top of the Makefile so the "install" and "clean" targets (used by
flatpak-builder and rm -rf) are always executed regardless of files or
directories named "install" or "clean".

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19caaad8-cde4-401c-8c8d-f837eb3a4b38

📥 Commits

Reviewing files that changed from the base of the PR and between 36861de and 6007cc4.

📒 Files selected for processing (4)
  • packages/app/scripts/flathub/.gitignore
  • packages/app/scripts/flathub/Makefile
  • packages/app/scripts/flathub/app.deepink.Deepink.yaml
  • packages/site/public/.well-known/org.flathub.VerifiedApps.txt
✅ Files skipped from review due to trivial changes (1)
  • packages/app/scripts/flathub/.gitignore

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Cloudflare Pages Deployment

Event Name: pull_request
Environment: preview
Project: deepink
Built with commit: 7b8e52f
Preview URL: https://8393b080.deepink.pages.dev
Branch Preview URL: https://284-publish-on-flathub.deepink.pages.dev

Wrangler Output

⛅️ wrangler 4.87.0
───────────────────
Uploading... (201/201)
✨ Success! Uploaded 0 files (201 already uploaded) (0.31 sec)

🌎 Deploying...
✨ Deployment complete! Take a peek over at https://8393b080.deepink.pages.dev
✨ Deployment alias URL: https://284-publish-on-flathub.deepink.pages.dev

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Cloudflare Pages Deployment

Event Name: pull_request
Environment: preview
Project: deepink
Built with commit: c557250
Preview URL: https://b366f622.deepink.pages.dev
Branch Preview URL: https://284-publish-on-flathub.deepink.pages.dev

Wrangler Output

⛅️ wrangler 4.87.0
───────────────────
Uploading... (201/201)
✨ Success! Uploaded 0 files (201 already uploaded) (0.87 sec)

🌎 Deploying...
✨ Deployment complete! Take a peek over at https://b366f622.deepink.pages.dev
✨ Deployment alias URL: https://284-publish-on-flathub.deepink.pages.dev

@github-actions
github-actions Bot requested a deployment to preview May 4, 2026 15:45 Abandoned
@vitonsky vitonsky changed the title build: publish on flathub build: configure a flatpak May 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/app/scripts/flathub/Makefile`:
- Around line 14-15: The clean target in the Makefile currently removes
${BUILD_DIR} and ${REPO_DIR} but omits the deepink.flatpak artifact created by
the deepink.flatpak target; update the clean target to also remove
deepink.flatpak (e.g., include ./deepink.flatpak in the rm -rf invocation
alongside ./${BUILD_DIR} and ./${REPO_DIR}) so all three ignored build artifacts
are cleaned consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42fd90bf-8bd4-4419-8b50-d57abd8d9e0c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a7ef22 and dbba7e2.

📒 Files selected for processing (1)
  • packages/app/scripts/flathub/Makefile

Comment thread packages/app/scripts/flathub/Makefile
@vitonsky
vitonsky merged commit 597a9f9 into master May 4, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish on flathub

1 participant