Skip to content

Commit ec678bc

Browse files
committed
Github action for Linux Flatpak creation
1 parent 6ea24d5 commit ec678bc

File tree

7 files changed

+102
-40
lines changed

7 files changed

+102
-40
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Linux Flatpak
2+
3+
on:
4+
push:
5+
branches:
6+
- test
7+
8+
jobs:
9+
build-flatpak:
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Install system dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo DEBIAN_FRONTEND=noninteractive TZ=Europe apt-get install -y \
22+
clang cmake ninja-build pkg-config libgtk-3-dev libunwind-dev \
23+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
24+
keybinder-3.0 appindicator3-0.1 \
25+
flatpak flatpak-builder
26+
27+
- name: Setup Flutter
28+
uses: subosito/flutter-action@v2
29+
with:
30+
flutter-version: '3.38.6'
31+
channel: 'stable'
32+
33+
- name: Setup Flatpak
34+
run: |
35+
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
36+
sudo flatpak install -y flathub org.freedesktop.Platform//23.08
37+
sudo flatpak install -y flathub org.freedesktop.Sdk//23.08
38+
sudo flatpak install -y flathub org.freedesktop.appstream-glib
39+
40+
- name: Build Flutter app and generate Flatpak
41+
run: |
42+
cd flatpak
43+
./build-flutter-app.sh
44+
45+
- name: Upload Flatpak artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: dlna-player-flatpak
49+
path: flatpak/de.luedtke.dlna_player.flatpak
50+
if-no-files-found: error
51+
52+
- name: Create Release
53+
uses: softprops/action-gh-release@v1
54+
with:
55+
tag_name: flatpak-${{ github.sha }}
56+
name: Flatpak Build ${{ github.sha }}
57+
draft: false
58+
prerelease: true
59+
files: flatpak/de.luedtke.dlna_player.flatpak
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
flutter 3.38.5-stable
1+
flutter 3.38.6-stable

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ this token in the settings dialog that's available via the 3-dot menu in the upp
9999
### General
100100
We need a special Docker image for building the app and the flatpak version of it. It's best to use the oldest
101101
supported Linux OS for this task, to get the widest OS support for our flatpak app. I'm using the LTS version
102-
Ubuntu 20.04. The [Dockerfile](./flatpak/Dockerfile) takes this as the base image and installs then all the necessary dependencies
102+
Ubuntu 22.04. The [Dockerfile](./flatpak/Dockerfile) takes this as the base image and installs then all the necessary dependencies
103103
to be able to compile the source code for Linux. In addition, the flatpak utilities are also installed. It's also
104104
important to install all the dependencies that the Linux version of the used Flutter packages needs. You find
105105
this information typically on pub.dev at the Linux version of the used package.
106106

107-
The build time for this image is approx. 10 minutes on my machine and the resulting image size is around 12GB.
107+
The build time for this image is approx. 10 minutes on my machine and the resulting image size is around 10GB.
108108

109109
### Image for Flutter and Flatpak
110110
Build the image:

flatpak/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Europe apt-get -y install tzdata
44

@@ -7,7 +7,7 @@ RUN apt-get -y install tree curl file git unzip xz-utils zip clang cmake ninja-b
77
# Install GStreamer dependencies (needed by audioplayers)
88
RUN apt-get -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
99
# Install app-specific dependencies
10-
RUN apt-get -y install keybinder-3.0 appindicator3-0.1 libappindicator3-1 libappindicator3-dev
10+
RUN apt-get -y install keybinder-3.0 appindicator3-0.1
1111
# Prepare environment for building Flatpak
1212
RUN apt-get -y install flatpak flatpak-builder
1313
RUN flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

flatpak/build-flutter-app.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ cd ..
1212

1313
# Build Flutter app
1414
flutter --disable-analytics
15+
flutter --version
1516
flutter clean
1617
flutter gen-l10n
1718
flutter build linux --release

pubspec.lock

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ packages:
55
dependency: transitive
66
description:
77
name: _fe_analyzer_shared
8-
sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d
8+
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "91.0.0"
11+
version: "85.0.0"
1212
analyzer:
1313
dependency: transitive
1414
description:
1515
name: analyzer
16-
sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08
16+
sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d"
1717
url: "https://pub.dev"
1818
source: hosted
19-
version: "8.4.1"
19+
version: "7.7.1"
2020
archive:
2121
dependency: transitive
2222
description:
@@ -205,10 +205,10 @@ packages:
205205
dependency: transitive
206206
description:
207207
name: ffi
208-
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
208+
sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c
209209
url: "https://pub.dev"
210210
source: hosted
211-
version: "2.1.4"
211+
version: "2.1.5"
212212
file:
213213
dependency: transitive
214214
description:
@@ -247,10 +247,10 @@ packages:
247247
dependency: "direct main"
248248
description:
249249
name: flutter_riverpod
250-
sha256: "9e2d6907f12cc7d23a846847615941bddee8709bf2bfd274acdf5e80bcf22fde"
250+
sha256: "38ec6c303e2c83ee84512f5fc2a82ae311531021938e63d7137eccc107bf3c02"
251251
url: "https://pub.dev"
252252
source: hosted
253-
version: "3.0.3"
253+
version: "3.1.0"
254254
flutter_test:
255255
dependency: "direct dev"
256256
description: flutter
@@ -345,10 +345,10 @@ packages:
345345
dependency: transitive
346346
description:
347347
name: image
348-
sha256: "48c11d0943b93b6fb29103d956ff89aafeae48f6058a3939649be2093dcff0bf"
348+
sha256: "492bd52f6c4fbb6ee41f781ff27765ce5f627910e1e0cbecfa3d9add5562604c"
349349
url: "https://pub.dev"
350350
source: hosted
351-
version: "4.7.1"
351+
version: "4.7.2"
352352
intl:
353353
dependency: "direct main"
354354
description:
@@ -505,18 +505,18 @@ packages:
505505
dependency: transitive
506506
description:
507507
name: path_provider_android
508-
sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e
508+
sha256: "3b4c1fc3aa55ddc9cd4aa6759984330d5c8e66aa7702a6223c61540dc6380c37"
509509
url: "https://pub.dev"
510510
source: hosted
511-
version: "2.2.22"
511+
version: "2.2.19"
512512
path_provider_foundation:
513513
dependency: transitive
514514
description:
515515
name: path_provider_foundation
516-
sha256: "6d13aece7b3f5c5a9731eaf553ff9dcbc2eff41087fd2df587fd0fed9a3eb0c4"
516+
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
517517
url: "https://pub.dev"
518518
source: hosted
519-
version: "2.5.1"
519+
version: "2.4.2"
520520
path_provider_linux:
521521
dependency: transitive
522522
description:
@@ -593,10 +593,10 @@ packages:
593593
dependency: transitive
594594
description:
595595
name: riverpod
596-
sha256: c406de02bff19d920b832bddfb8283548bfa05ce41c59afba57ce643e116aa59
596+
sha256: "16ff608d21e8ea64364f2b7c049c94a02ab81668f78845862b6e88b71dd4935a"
597597
url: "https://pub.dev"
598598
source: hosted
599-
version: "3.0.3"
599+
version: "3.1.0"
600600
screen_retriever:
601601
dependency: transitive
602602
description:
@@ -641,26 +641,26 @@ packages:
641641
dependency: "direct main"
642642
description:
643643
name: shared_preferences
644-
sha256: "2939ae520c9024cb197fc20dee269cd8cdbf564c8b5746374ec6cacdc5169e64"
644+
sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5"
645645
url: "https://pub.dev"
646646
source: hosted
647-
version: "2.5.4"
647+
version: "2.5.3"
648648
shared_preferences_android:
649649
dependency: transitive
650650
description:
651651
name: shared_preferences_android
652-
sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc"
652+
sha256: bd14436108211b0d4ee5038689a56d4ae3620fd72fd6036e113bf1345bc74d9e
653653
url: "https://pub.dev"
654654
source: hosted
655-
version: "2.4.18"
655+
version: "2.4.13"
656656
shared_preferences_foundation:
657657
dependency: transitive
658658
description:
659659
name: shared_preferences_foundation
660-
sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f"
660+
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
661661
url: "https://pub.dev"
662662
source: hosted
663-
version: "2.5.6"
663+
version: "2.5.4"
664664
shared_preferences_linux:
665665
dependency: transitive
666666
description:
@@ -870,18 +870,18 @@ packages:
870870
dependency: transitive
871871
description:
872872
name: url_launcher_android
873-
sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611"
873+
sha256: "81777b08c498a292d93ff2feead633174c386291e35612f8da438d6e92c4447e"
874874
url: "https://pub.dev"
875875
source: hosted
876-
version: "6.3.28"
876+
version: "6.3.20"
877877
url_launcher_ios:
878878
dependency: transitive
879879
description:
880880
name: url_launcher_ios
881-
sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad
881+
sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7
882882
url: "https://pub.dev"
883883
source: hosted
884-
version: "6.3.6"
884+
version: "6.3.4"
885885
url_launcher_linux:
886886
dependency: transitive
887887
description:
@@ -894,10 +894,10 @@ packages:
894894
dependency: transitive
895895
description:
896896
name: url_launcher_macos
897-
sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18"
897+
sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f
898898
url: "https://pub.dev"
899899
source: hosted
900-
version: "3.2.5"
900+
version: "3.2.3"
901901
url_launcher_platform_interface:
902902
dependency: transitive
903903
description:
@@ -942,18 +942,18 @@ packages:
942942
dependency: transitive
943943
description:
944944
name: vm_service
945-
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
945+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
946946
url: "https://pub.dev"
947947
source: hosted
948-
version: "15.0.2"
948+
version: "15.0.0"
949949
watcher:
950950
dependency: transitive
951951
description:
952952
name: watcher
953-
sha256: f52385d4f73589977c80797e60fe51014f7f2b957b5e9a62c3f6ada439889249
953+
sha256: "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635"
954954
url: "https://pub.dev"
955955
source: hosted
956-
version: "1.2.0"
956+
version: "1.2.1"
957957
web:
958958
dependency: transitive
959959
description:
@@ -1027,5 +1027,5 @@ packages:
10271027
source: hosted
10281028
version: "3.1.3"
10291029
sdks:
1030-
dart: ">=3.9.0 <4.0.0"
1031-
flutter: ">=3.35.0"
1030+
dart: ">=3.8.0 <4.0.0"
1031+
flutter: ">=3.32.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A DLNA Audio Player made with Flutter.
33

44
publish_to: 'none'
55

6-
version: 1.0.0+28
6+
version: 1.0.0+29
77

88
environment:
99
sdk: '^3.7.0'

0 commit comments

Comments
 (0)