From 16948c3e0f285f195f7f3cd525d1456eb4620fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lollipopkit=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7?= =?UTF-8?q?=EF=B8=8F?= <10864310+lollipopkit@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:56:03 +0800 Subject: [PATCH] new: provide `.deb` & `.rpm` --- .github/workflows/release.yml | 21 +++++++++++++++++-- distribute_options.yaml | 13 ++++++++++++ lib/data/provider/server.dart | 8 +++---- linux/packaging/deb/make_config.yaml | 31 ++++++++++++++++++++++++++++ linux/packaging/rpm/make_config.yaml | 23 +++++++++++++++++++++ 5 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 distribute_options.yaml create mode 100644 linux/packaging/deb/make_config.yaml create mode 100644 linux/packaging/rpm/make_config.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2cfa97b..37b231fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,14 +53,31 @@ jobs: uses: actions/checkout@v4 - name: Install Flutter uses: subosito/flutter-action@v2 + - name: Install dependencies + run: | + sudo apt update + # Basic + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev libvulkan-dev desktop-file-utils + # App Specific + sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev + # Packaging + sudo apt install -y rpm patchelf - name: Build run: | - dart run fl_build -p linux + dart run fl_build + dart run flutter_distributor:main release --name linux --skip-clean + - name: Rename artifacts + run: | + deb_name=$(ls dist/*/*.deb) + mv $deb_name ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.deb + rpm_name=$(ls dist/*/*.rpm) + mv $rpm_name ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.rpm - name: Create Release uses: softprops/action-gh-release@v2 with: files: | - ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.AppImage + ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.deb + ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.rpm env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/distribute_options.yaml b/distribute_options.yaml new file mode 100644 index 00000000..0f5d29ab --- /dev/null +++ b/distribute_options.yaml @@ -0,0 +1,13 @@ +variables: +output: dist/ +releases: + - name: linux + jobs: + - name: release-linux-deb + package: + platform: linux + target: deb + - name: release-linux-rpm + package: + platform: linux + target: rpm diff --git a/lib/data/provider/server.dart b/lib/data/provider/server.dart index 7e9e56b3..5b8adc41 100644 --- a/lib/data/provider/server.dart +++ b/lib/data/provider/server.dart @@ -210,12 +210,10 @@ class ServerProvider extends Provider { Stores.setting.serverOrder.put(serverOrder.value); Stores.server.deleteAll(); _updateTags(); + bakSync.sync(milliDelay: 1000); } - static Future updateServer( - Spi old, - Spi newSpi, - ) async { + static Future updateServer(Spi old, Spi newSpi) async { if (old != newSpi) { Stores.server.update(old, newSpi); servers[old.id]?.value.spi = newSpi; @@ -236,7 +234,7 @@ class ServerProvider extends Provider { } } _updateTags(); - bakSync.sync(); + bakSync.sync(milliDelay: 1000); } static void _setServerState(VNode s, ServerConn ss) { diff --git a/linux/packaging/deb/make_config.yaml b/linux/packaging/deb/make_config.yaml new file mode 100644 index 00000000..990c4ec2 --- /dev/null +++ b/linux/packaging/deb/make_config.yaml @@ -0,0 +1,31 @@ +display_name: ServerBox +package_name: cn.lpkt.serverbox +maintainer: + name: lollipopkit + email: 10864310+lollipopkit@users.noreply.github.com +# co_authors: +# - name: +# email: +priority: optional +section: x11 +installed_size: 6604 +essential: false +icon: assets/app_icon.png + +# postinstall_scripts: +# - echo "Installed my awesome app" +# postuninstall_scripts: +# - echo "Surprised Pickachu face" + +keywords: + - server + - ssh + - sftp + - system + +generic_name: ServerBox + +categories: + - Utility + +startup_notify: true \ No newline at end of file diff --git a/linux/packaging/rpm/make_config.yaml b/linux/packaging/rpm/make_config.yaml new file mode 100644 index 00000000..6d465c6a --- /dev/null +++ b/linux/packaging/rpm/make_config.yaml @@ -0,0 +1,23 @@ +icon: assets/app_icon.png +summary: Server status and tools to manage server. +group: Application/Utility +vendor: lollipopkit +packager: lollipopkit +packagerEmail: 10864310+lollipopkit@users.noreply.github.com +license: GPLv3 +url: https://github.com/lollipopkit/flutter_server_box + +display_name: ServerBox + +keywords: + - server + - ssh + - sftp + - system + +generic_name: ServerBox + +categories: + - Utility + +startup_notify: true \ No newline at end of file