Add Flatpak release workflow and CI manifest

This commit is contained in:
Hakan Seven 2026-03-22 17:31:06 +03:00
commit 95d4a2d7c3
2 changed files with 83 additions and 0 deletions

50
.github/workflows/flatpak-release.yml vendored Normal file
View file

@ -0,0 +1,50 @@
name: Flatpak Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install flatpak and flatpak-builder
run: |
sudo apt-get update -q
sudo apt-get install -y flatpak flatpak-builder
- name: Add Flathub remote
run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- name: Install runtimes
run: |
flatpak install -y --user \
org.freedesktop.Platform//24.08 \
org.freedesktop.Sdk//24.08 \
org.freedesktop.Sdk.Extension.rust-stable//24.08
- name: Generate cargo-sources.json
run: |
pip3 install tomlkit aiohttp
git clone --depth=1 https://github.com/flatpak/flatpak-builder-tools.git /tmp/flatpak-builder-tools
python3 /tmp/flatpak-builder-tools/cargo/flatpak-cargo-generator.py \
Cargo.lock -o flatpak/cargo-sources.json
- name: Build Flatpak
run: |
flatpak-builder --force-clean --user --repo=repo build-dir \
flatpak/io.github.HakanSeven12.H7CAD.ci.yml
- name: Create bundle
run: |
flatpak build-bundle repo H7CAD.flatpak io.github.HakanSeven12.H7CAD
- name: Upload bundle to release
uses: softprops/action-gh-release@v2
with:
files: H7CAD.flatpak

View file

@ -0,0 +1,33 @@
app-id: io.github.HakanSeven12.H7CAD
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: H7CAD
finish-args:
- --device=dri
- --socket=wayland
- --socket=fallback-x11
- --share=ipc
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/H7CAD/cargo
modules:
- name: H7CAD
buildsystem: simple
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml --verbose
- cargo --offline build --release --verbose
- install -Dm755 target/release/H7CAD /app/bin/H7CAD
- install -Dm644 assets/logo.svg /app/share/icons/hicolor/scalable/apps/io.github.HakanSeven12.H7CAD.svg
- install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.desktop /app/share/applications/io.github.HakanSeven12.H7CAD.desktop
- install -Dm644 flatpak/io.github.HakanSeven12.H7CAD.metainfo.xml /app/share/metainfo/io.github.HakanSeven12.H7CAD.metainfo.xml
sources:
- type: dir
path: .
- flatpak/cargo-sources.json