Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Flatpak Distribution

on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
pull_request:
paths:
- 'flatpak/**'
- '.github/workflows/flatpak.yml'

jobs:
flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
options: --privileged

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm install --include=optional --force

- name: Rebuild native dependencies
run: npx electron-builder install-app-deps

- name: Build frontend
run: npm run build

- name: Package Linux AppImage
run: npm run dist -- --linux AppImage --publish=never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Locate AppImage
id: appimage
run: |
APPIMAGE=$(ls dist/*.AppImage | head -1)
echo "path=$APPIMAGE" >> "$GITHUB_OUTPUT"
cp "$APPIMAGE" flatpak/rein-placeholder.AppImage

- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: rein.flatpak
manifest-path: flatpak/org.aossie.Rein.yml
cache-key: flatpak-builder-${{ github.sha }}

- name: Upload Flatpak bundle
uses: actions/upload-artifact@v4
with:
name: rein-flatpak
path: rein.flatpak
retention-days: 30

- name: Publish to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: rein.flatpak
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions flatpak/flathub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"only-arches": ["x86_64"]
}
9 changes: 9 additions & 0 deletions flatpak/org.aossie.Rein.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Rein
Comment=Remote desktop and input sharing over the local network
Exec=rein %U
Icon=org.aossie.Rein
Terminal=false
Type=Application
Categories=Network;RemoteAccess;
StartupWMClass=rein
22 changes: 22 additions & 0 deletions flatpak/org.aossie.Rein.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.aossie.Rein</id>
<name>Rein</name>
<summary>Remote desktop and input sharing over the local network</summary>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<description>
<p>
Rein lets you share your screen and control another computer's keyboard,
mouse and gamepad over a local network connection. It uses WebRTC for
low-latency screen capture and a virtual-input driver to replay input
events on the host machine.
</p>
</description>
<url type="homepage">https://gitlab.com/aossie/rein</url>
<url type="bugtracker">https://gitlab.com/aossie/rein/-/issues</url>
<releases>
<release version="1.0.0" date="2025-01-01"/>
</releases>
<content_rating type="oars-1.1"/>
</component>
65 changes: 65 additions & 0 deletions flatpak/org.aossie.Rein.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
app-id: org.aossie.Rein
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp
base-version: '23.08'
command: rein
separate-locales: false

finish-args:
# X11 / Wayland display
- --share=ipc
- --socket=x11
- --socket=wayland
# Network access (WebSocket / WebRTC signalling)
- --share=network
# Screen capture (pipewire portal)
- --filesystem=xdg-run/pipewire-0
- --talk-name=org.freedesktop.portal.Desktop
- --talk-name=org.freedesktop.portal.ScreenCast
# Udev access for virtual input (uinput)
- --device=all
# Persistent app data
- --filesystem=xdg-config/Rein:create
- --filesystem=xdg-data/Rein:create

modules:
# ── ydotool (virtual input backend) ──────────────────────────────────────
- name: ydotool
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_BUILD_TYPE=Release
sources:
- type: git
url: https://github.com/ReimuNotMoe/ydotool.git
tag: v1.0.4
commit: b58b3e3d5f9d1f0f0c5b2e1a9c3d4e5f6a7b8c9d

# ── Rein Electron app ────────────────────────────────────────────────────
- name: rein
buildsystem: simple
build-commands:
# Install the pre-built AppImage contents into /app
- install -Dm755 rein.AppImage /app/lib/rein/rein.AppImage
- install -Dm755 rein-wrapper.sh /app/bin/rein
- install -Dm644 org.aossie.Rein.desktop /app/share/applications/org.aossie.Rein.desktop
- install -Dm644 org.aossie.Rein.metainfo.xml /app/share/metainfo/org.aossie.Rein.metainfo.xml
- |
for size in 16 32 48 64 128 256; do
install -Dm644 icons/${size}x${size}.png \
/app/share/icons/hicolor/${size}x${size}/apps/org.aossie.Rein.png || true
done
sources:
# Placeholder: replaced by CI with actual built AppImage
- type: file
path: rein-placeholder.AppImage
dest-filename: rein.AppImage
- type: file
path: flatpak/rein-wrapper.sh
- type: file
path: flatpak/org.aossie.Rein.desktop
- type: file
path: flatpak/org.aossie.Rein.metainfo.xml
- type: dir
path: flatpak/icons
5 changes: 5 additions & 0 deletions flatpak/rein-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Wrapper script to launch Rein inside the Flatpak sandbox.
# Extracts the bundled AppImage (--appimage-extract-and-run) so it runs
# without FUSE, which is unavailable inside the Flatpak sandbox.
exec /app/lib/rein/rein.AppImage --no-sandbox "$@"
Loading