Skip to content

Commit 6703538

Browse files
committed
flatpak
1 parent 732028e commit 6703538

4 files changed

Lines changed: 122 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build Flatpak
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-flatpak:
12+
runs-on: ${{ matrix.runner }}
13+
strategy:
14+
matrix:
15+
include:
16+
- arch: x86_64
17+
runner: ubuntu-latest
18+
- arch: aarch64
19+
runner: ubuntu-24.04-arm
20+
container:
21+
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08
22+
options: --privileged
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Get Flutter SHA256
29+
id: flutter-hash
30+
run: |
31+
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.1-stable.tar.xz"
32+
FLUTTER_SHA256=$(curl -sL "$FLUTTER_URL" | sha256sum | cut -d' ' -f1)
33+
echo "sha256=$FLUTTER_SHA256" >> $GITHUB_OUTPUT
34+
echo "Flutter SHA256: $FLUTTER_SHA256"
35+
36+
- name: Update manifest with Flutter SHA256
37+
run: |
38+
sed -i "s/FLUTTER_SHA256/${{ steps.flutter-hash.outputs.sha256 }}/" dev.xmit.bob.yaml
39+
40+
- name: Build Flatpak
41+
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
42+
with:
43+
bundle: bob-${{ matrix.arch }}.flatpak
44+
manifest-path: dev.xmit.bob.yaml
45+
cache-key: flatpak-builder-${{ matrix.arch }}-${{ github.sha }}
46+
arch: ${{ matrix.arch }}
47+
48+
- name: Upload Flatpak bundle
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: bob-flatpak-${{ matrix.arch }}
52+
path: bob-${{ matrix.arch }}.flatpak
53+
retention-days: 30

‎dev.xmit.bob.desktop‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Name=Oncle Bob
3+
Comment=Start, build, preview, launch static websites
4+
Exec=bob
5+
Icon=dev.xmit.bob
6+
Terminal=false
7+
Type=Application
8+
Categories=Development;Utility;
9+
StartupNotify=true
10+
StartupWMClass=bob

‎dev.xmit.bob.metainfo.xml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>dev.xmit.bob</id>
4+
<metadata_license>0BSD</metadata_license>
5+
<project_license>0BSD</project_license>
6+
<name>Bob</name>
7+
<summary>Oncle Bob builds and launches web apps</summary>
8+
<description>
9+
<p>
10+
Bob is a utility application that helps you build and launch web applications.
11+
</p>
12+
</description>
13+
<launchable type="desktop-id">dev.xmit.bob.desktop</launchable>
14+
<provides>
15+
<binary>bob</binary>
16+
</provides>
17+
<releases>
18+
<release version="0.0.2" date="2024-11-18"/>
19+
</releases>
20+
<content_rating type="oars-1.1"/>
21+
</component>

‎dev.xmit.bob.yaml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
app-id: dev.xmit.bob
2+
runtime: org.freedesktop.Platform
3+
runtime-version: "25.08"
4+
sdk: org.freedesktop.Sdk
5+
command: bob
6+
7+
finish-args:
8+
- --share=ipc
9+
- --socket=wayland
10+
- --socket=fallback-x11
11+
- --device=dri
12+
- --share=network
13+
- --filesystem=host
14+
15+
modules:
16+
- name: bob
17+
buildsystem: simple
18+
build-commands:
19+
- tar xf flutter-*.tar.xz
20+
- export PATH="$PWD/flutter/bin:$PATH"
21+
- flutter config --no-analytics
22+
- flutter doctor
23+
- flutter pub get
24+
- flutter build linux --release
25+
- mkdir -p /app/bin
26+
- cp -r build/linux/x64/release/bundle/* /app/bin/
27+
- ln -s /app/bin/bob /app/bin/dev.xmit.bob
28+
- install -Dm644 dev.xmit.bob.desktop /app/share/applications/dev.xmit.bob.desktop
29+
- install -Dm644 dist/app_icon_256.png /app/share/icons/hicolor/256x256/apps/dev.xmit.bob.png
30+
- install -Dm644 dev.xmit.bob.metainfo.xml /app/share/metainfo/dev.xmit.bob.metainfo.xml
31+
32+
sources:
33+
- type: archive
34+
url: https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.38.1-stable.tar.xz
35+
sha256: FLUTTER_SHA256
36+
37+
- type: dir
38+
path: .

0 commit comments

Comments
 (0)