Skip to content

Commit

Permalink
feat: add flatpak support
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdinazor committed Feb 4, 2025
1 parent 5334ef7 commit fa099ed
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,35 @@ jobs:
name: linux-artifact
path: dist/linux/finch-${{ env.VERSION }}-linux-all.deb

build-flatpak:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
options: --privileged
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Flatpak environment
run: |
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
- name: Build Flatpak bundle
run: |
flatpak-builder --repo=repo --force-clean build-dir flatpak/com.furkankalkan.FinchS3.yml
flatpak build-bundle repo finch-${{ env.VERSION }}-linux-x86_64.flatpak com.furkankalkan.FinchS3
- name: Upload Flatpak Artifact
uses: actions/upload-artifact@v4
with:
name: flatpak-artifact
path: finch-${{ env.VERSION }}-linux-x86_64.flatpak

release:
needs: [build-macos-arm, build-macos-intel, build-windows, build-linux]
needs: [build-macos-arm, build-macos-intel, build-windows, build-linux, build-flatpak]
runs-on: ubuntu-latest
steps:
- name: Download MacOS Apple Silicon Artifact
Expand All @@ -237,6 +262,11 @@ jobs:
with:
name: linux-artifact

- name: Download Flatpak Artifact
uses: actions/download-artifact@v4
with:
name: flatpak-artifact

- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand All @@ -249,3 +279,4 @@ jobs:
finch-${{ env.VERSION }}-macos-x86_64.dmg
finch-${{ env.VERSION }}-windows-x86_64.msi
finch-${{ env.VERSION }}-linux-all.deb
finch-${{ env.VERSION }}-linux-x86_64.flatpak
66 changes: 66 additions & 0 deletions flatpak/com.furkankalkan.FinchS3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
app-id: com.furkankalkan.FinchS3
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: finch
finish-args:
- --share=network
- --share=ipc
- --socket=x11
- --socket=wayland
- --filesystem=home
# For keyring access
- --talk-name=org.freedesktop.secrets
- --filesystem=xdg-config/finch:create

build-options:
build-args:
- --share=network

modules:
- name: python3-pip
buildsystem: simple
build-commands:
- python3 -m ensurepip
- pip3 install --upgrade pip
cleanup:
- /lib/python*/site-packages/pip
- /lib/python*/site-packages/setuptools

- name: python3-boto3-slim
buildsystem: simple
build-commands:
# Install boto3 and dependencies
- pip3 install --prefix=/app boto3==1.35.5
# Find botocore version and trim it
- |
BOTOCORE_PATH=$(python3 -c "import botocore; print(botocore.__path__[0])")
cd $BOTOCORE_PATH/data
for dir in *; do
if [[ ! "$dir" =~ ^s3.* ]]; then
rm -rf "$dir"
fi
done
- name: python3-requirements
buildsystem: simple
build-commands:
- pip3 install --prefix=/app --no-cache-dir PyQt5==5.15.11 keyring==25.3.0 python-slugify==8.0.4

- name: finch
buildsystem: simple
build-commands:
# Copy project files to a known location
- cp -r /run/build/finch/project /app/
# Install the package
- pip3 install --prefix=/app --no-deps /app/project
# Install application files
- install -Dm644 /app/project/icon.png /app/share/icons/hicolor/256x256/apps/com.furkankalkan.FinchS3.png
- install -Dm644 /app/project/flatpak/files/com.furkankalkan.FinchS3.desktop /app/share/applications/com.furkankalkan.FinchS3.desktop
- install -Dm644 /app/project/flatpak/files/com.furkankalkan.FinchS3.metainfo.xml /app/share/metainfo/com.furkankalkan.FinchS3.metainfo.xml
# Cleanup
- rm -rf /app/project
sources:
- type: dir
path: ..
dest: project
9 changes: 9 additions & 0 deletions flatpak/files/com.furkankalkan.FinchS3.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Finch S3 Client
Comment=Open source and cross-platform GUI client for Amazon S3
Exec=finch
Icon=com.furkankalkan.FinchS3
Terminal=false
Type=Application
Categories=Network;FileTransfer;
Keywords=s3;aws;storage;cloud;
33 changes: 33 additions & 0 deletions flatpak/files/com.furkankalkan.FinchS3.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.furkankalkan.FinchS3</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Finch S3 Client</name>
<summary>GUI client for Amazon S3 and compatible storage platforms</summary>
<description>
<p>
Open source and cross-platform GUI client for Amazon S3 and compatible storage platforms.
</p>
<p>Features:</p>
<ul>
<li>Support for multiple credential through access &amp; secret keys</li>
<li>Use cross-platform secure secret key storage</li>
<li>Browse and manage your S3 buckets and objects in file tree</li>
<li>Delete folders and buckets recursively</li>
<li>Upload and download files</li>
<li>Searching buckets &amp; objects</li>
</ul>
</description>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/mantis-software-company/finch/main/img.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://github.com/mantis-software-company/finch</url>
<developer_name>Furkan Kalkan</developer_name>
<releases>
<release version="1.0.0a1" date="2024-01-01"/>
</releases>
<content_rating type="oars-1.1"/>
</component>

0 comments on commit fa099ed

Please sign in to comment.