experimental release on github

This commit is contained in:
Zinny
2025-08-15 10:38:12 +02:00
commit 04e6cd458c
8 changed files with 286 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
name: Build Flatpak
on:
workflow_dispatch:
push:
branches: [ main, master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Flatpak tooling
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder imagemagick curl
- name: Configure Flathub and required runtimes
run: |
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak --user install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
- name: Build Flatpak and create bundle
run: |
chmod +x ./build-flatpak.sh
./build-flatpak.sh
- name: Upload .flatpak bundle artifact
uses: actions/upload-artifact@v4
with:
name: publii-flatpak
path: publii.flatpak
if-no-files-found: error
+24
View File
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
+30
View File
@@ -0,0 +1,30 @@
# Unofficial Publii Flatpak
Unofficial, work in progress, rudimentary, experimental & probably unstable Flatpak build for Publii - in other words, use it if you know you can handle errors.
## Prerequisites
Before building, you need to install Flatpak, flatpak-builder, and ImageMagick:
```bash
sudo apt update
sudo apt install flatpak flatpak-builder imagemagick
```
Add the Flathub repository if not already added:
```bash
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
## Dynamic Version Handling
The `build-flatpak.sh` script dynamically fetches the latest Publii AppImage from the official website. It does not automatically update the `io.publii.Publii.metainfo.xml` (yet).
## Permissions
The Flatpak has the following permissions:
- Network access (for publishing sites)
- Documents directory access (for storing sites and projects)
- Desktop integration (notifications, file chooser)
- Hardware acceleration (OpenGL/Vulkan, can't hurt because of Electron probably?)
- Session bus access (for... things?)
### Known Issues
- `Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket` - found in console, not sure if this is normal in sandboxed environments
- `Failed to load module "canberra-gtk-module"` - *not researched yet*
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
# Exit on error
set -e
echo "Checking prerequisites..."
# Check if required tools are available
if ! flatpak list | grep -q "org.freedesktop.Platform.*23.08"; then
echo "Required Freedesktop runtime is not installed. Please install it manually with the following command:"
echo "flatpak install --user flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 -y"
exit 1
fi
for cmd in flatpak-builder convert curl; do
if ! command -v $cmd &> /dev/null; then
echo "$cmd is not installed. Please install it first."
exit 1
fi
done
# Get the latest Publii release URL and version #TODO: wacky web scraping, maybe use github api to get release number
echo "Fetching the latest Publii release..."
LATEST_RELEASE_URL=$(curl -s https://getpublii.com/download/ | grep -oE 'https://cdn.getpublii.com/Publii-[0-9]+\.[0-9]+\.[0-9]+\.AppImage' | head -n 1)
LATEST_VERSION=$(echo "$LATEST_RELEASE_URL" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ -z "$LATEST_RELEASE_URL" ]; then
echo "Error: Unable to fetch the latest Publii release URL. Please verify the website availability."
exit 1
fi
if [ -z "$LATEST_VERSION" ]; then
echo "Error: Unable to extract the Publii version from the URL."
exit 1
fi
# Download the latest Publii AppImage
echo "Latest Publii version: $LATEST_VERSION"
echo "Downloading Publii AppImage..."
curl -L "$LATEST_RELEASE_URL" -o "Publii-$LATEST_VERSION.AppImage"
# Ensure the AppImage is executable
chmod +x "Publii-$LATEST_VERSION.AppImage"
# Extract the AppImage
echo "Extracting Publii AppImage..."
./"Publii-$LATEST_VERSION.AppImage" --appimage-extract
# Resize the icon to comply with Flatpak requirements (max 512x512)
ICON_PATH="squashfs-root/Publii.png"
if [ -f "$ICON_PATH" ]; then
convert "$ICON_PATH" -resize 512x512 "$ICON_PATH"
echo "Icon resized successfully."
else
echo "Warning: Icon file not found at $ICON_PATH"
fi
# Build the Flatpak
echo "Begin build..."
flatpak-builder --user --install --force-clean build-dir io.publii.Publii.yml
echo "Build finished: flatpak run io.publii.Publii"
# Create bundle
echo "Creating .flatpak bundle file... (this may take a minute or two)"
flatpak build-bundle ~/.local/share/flatpak/repo ./publii.flatpak io.publii.Publii
echo "Bundle created: publii.flatpak"
# Optional, clean up files
rm -rf "Publii-$LATEST_VERSION.AppImage" squashfs-root build-dir .flatpak-builder
#echo "Temporary files cleaned up."
+11
View File
@@ -0,0 +1,11 @@
[Desktop Entry]
Name=Publii
Exec=publii --no-sandbox %U
Terminal=false
Type=Application
Icon=io.publii.Publii
StartupWMClass=Publii
Comment=The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.
Categories=Development;WebDevelopment;
Keywords=CMS;static;site;generator;blog;website;
MimeType=application/x-publii-project;
+33
View File
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.publii.Publii</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>Publii</name>
<summary>The most intuitive Static Site CMS designed for SEO-optimized and privacy-focused websites.</summary>
<description>
<p>
Creating a website doesn't have to be complicated or expensive. With the Publii app, the most intuitive CMS for static sites, you can create a beautiful, safe, and privacy-friendly website quickly and easily; perfect for anyone who wants a fast, secure website in a flash.
</p>
<p>
Unofficial, work in progress, rudimentary, experimental and probably unstable Flatpak build for Publii - in other words, use it if you know you can handle errors.
</p>
</description>
<launchable type="desktop-id">io.publii.Publii.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://getpublii.com/assets/images/publii-cms.webp</image>
</screenshot>
<screenshot>
<image>https://getpublii.com/assets/images/bg-themes.webp</image>
</screenshot>
</screenshots>
<url type="homepage">https://getpublii.com</url>
<url type="bugtracker">https://github.com/GetPublii/Publii/issues</url>
<url type="help">https://getpublii.com/docs</url>
<developer_name>Publii Contributors</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.46.5" date="2024-04-24"/>
</releases>
</component>
+71
View File
@@ -0,0 +1,71 @@
app-id: io.publii.Publii
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: publii
finish-args:
- --share=ipc
- --socket=x11
- --socket=wayland
- --device=dri
- --share=network
- --filesystem=xdg-documents
- --socket=session-bus
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.FileManager1
- --talk-name=org.freedesktop.portal.Desktop
- --talk-name=org.freedesktop.portal.FileChooser
- --talk-name=org.freedesktop.secrets
- --env=ELECTRON_TRASH=gio
- --env=GTK_A11Y=none
- --env=NO_AT_BRIDGE=1
modules:
- name: libsecret
buildsystem: meson
config-opts:
- -Dmanpage=false
- -Dvapi=false
- -Dgtk_doc=false
cleanup:
- /bin
- /include
- /lib/pkgconfig
- /share/gir-1.0
- /share/man
sources:
- type: archive
url: https://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.4.tar.xz
sha256: 163d08d783be6d4ab9a979ceb5a4fecbc1d9660d3c34168c581301cd53912b20
- name: publii
buildsystem: simple
build-commands:
- install -Dm755 publii-wrapper.sh /app/bin/publii
- install -Dm644 Publii.png /app/share/icons/hicolor/256x256/apps/io.publii.Publii.png
- install -Dm644 io.publii.Publii.desktop /app/share/applications/io.publii.Publii.desktop
- install -Dm644 io.publii.Publii.metainfo.xml /app/share/metainfo/io.publii.Publii.metainfo.xml
- mkdir -p /app/share/publii
- cp Publii /app/share/publii/
- cp -r resources /app/share/publii/
- cp -r locales /app/share/publii/
- cp *.pak /app/share/publii/
- cp *.bin /app/share/publii/
- cp *.dat /app/share/publii/
- cp *.so* /app/share/publii/
- cp chrome_* /app/share/publii/
- cp vk_* /app/share/publii/
- cp LICENSE* /app/share/publii/
- mkdir -p /app/share/publii/usr/lib
- cp -r usr/lib/* /app/share/publii/usr/lib/
- mkdir -p /app/share/publii/usr/share
- cp -r usr/share/* /app/share/publii/usr/share/
sources:
- type: dir
path: squashfs-root
- type: file
path: io.publii.Publii.desktop
- type: file
path: io.publii.Publii.metainfo.xml
- type: file
path: publii-wrapper.sh
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# Publii Flatpak wrapper script
export PUBLII_RESOURCES_PATH="/app/share/publii"
export LD_LIBRARY_PATH="/app/share/publii/usr/lib:/app/share/publii:$LD_LIBRARY_PATH"
# Suppress GTK accessibility warnings
export GTK_A11Y=none
export NO_AT_BRIDGE=1
# Set up the environment
cd /app/share/publii
# Run Publii with the proper library path and disable Electron sandbox
# (Flatpak provides its own sandboxing)
exec ./Publii --no-sandbox "$@"