From 5a3917a31ff76bf4b0b1c0ff7f5a670a15749952 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 25 Oct 2025 04:03:48 +0800 Subject: [PATCH] ci: add debian-system-qt-x64.deb package --- .github/workflows/build.yml | 26 ++++++++++++++++--- script/deploy_linux64_system_qt.sh | 20 +++++++++++++++ script/pack_debian_system_qt.sh | 40 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100755 script/deploy_linux64_system_qt.sh create mode 100755 script/pack_debian_system_qt.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 926787d..39c1b46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,6 +102,9 @@ jobs: - platform: ubuntu-22.04 qt_version: "6.10.0" target: amd64 + - platform: ubuntu-22.04 + qt_version: "6.2.0" + target: amd64 - platform: ubuntu-24.04-arm qt_version: "6.10.0" target: arm64 @@ -187,7 +190,7 @@ jobs: cd build curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" cmake -GNinja -DCMAKE_CXX_FLAGS="-static" -DOPENSSL_ROOT_DIR="$VCPKG_INSTALLATION_ROOT/installed/x64-mingw-static" -DCMAKE_BUILD_TYPE=Debug .. - ninja -j2 + ninja cd .. ./script/deploy_windows.sh - name: Legacy Windows - Generate MakeFile and Build @@ -204,7 +207,7 @@ jobs: cd build curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" cmake -GNinja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_BUILD_TYPE=Debug .. - ninja -j2 + ninja cd .. ./script/deploy_windows.sh ${{ matrix.target }} - name: WOA - Generate MakeFile and Build @@ -215,7 +218,7 @@ jobs: cd build curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. - ninja -j2 + ninja cd .. ./script/deploy_woa.sh - name: Build Installer with NSIS @@ -228,7 +231,7 @@ jobs: cp ThroneSetup.exe deployment/ - name: Linux - Generate MakeFile and Build shell: bash - if: contains( matrix.platform, 'ubuntu' ) + if: contains( matrix.platform, 'ubuntu' ) && matrix.qt_version != '6.2.0' run: | sudo apt update && sudo apt upgrade -y mkdir build @@ -238,6 +241,17 @@ jobs: ninja cd .. ./script/deploy_linux64.sh + - name: Linux Using System Qt - Generate MakeFile and Build + shell: bash + if: contains( matrix.platform, 'ubuntu' ) && matrix.qt_version == '6.2.0' + run: | + mkdir build + cd build + curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" .. + ninja + cd .. + ./script/deploy_linux64_system_qt.sh - name: macOS - Generate MakeFile and Build shell: bash if: matrix.platform == 'macos-latest' && matrix.qt_version != '6.4.3' @@ -299,6 +313,10 @@ jobs: mv Throne.deb $version_standalone-debian-x64.deb rm -rf Throne #### + bash ../script/pack_debian_system_qt.sh ${{ github.event.inputs.tag }} + mv Throne.deb $version_standalone-debian-system-qt-x64.deb + rm -rf Throne + #### mv linux-amd64 Throne zip -9 -r $version_standalone-linux-amd64.zip Throne rm -rf Throne diff --git a/script/deploy_linux64_system_qt.sh b/script/deploy_linux64_system_qt.sh new file mode 100755 index 0000000..422e2fe --- /dev/null +++ b/script/deploy_linux64_system_qt.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +source script/env_deploy.sh +DEST=$DEPLOYMENT/linux-system-qt-$ARCH +rm -rf $DEST +mkdir -p $DEST + +#### copy binary #### +cp $BUILD/Throne $DEST + +#### copy Throne.png #### +cp ./res/public/Throne.png $DEST + +#### copy Core #### +cd download-artifact +cd *linux-$ARCH +tar xvzf artifacts.tgz -C ../../ +cd ../.. +cp deployment/linux-$ARCH/Core $DEST diff --git a/script/pack_debian_system_qt.sh b/script/pack_debian_system_qt.sh new file mode 100755 index 0000000..5571afa --- /dev/null +++ b/script/pack_debian_system_qt.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +version="$1" + +mkdir -p Throne/DEBIAN +mkdir -p Throne/opt +cp -r linux-system-qt-amd64 Throne/opt +mv Throne/opt/linux-system-qt-amd64 Throne/opt/Throne + +# basic +cat >Throne/DEBIAN/control <<-EOF +Package: Throne +Version: $version +Architecture: amd64 +Maintainer: Mahdi Mahdi.zrei@gmail.com +Depends: desktop-file-utils, libqt6core6, libqt6gui6, libqt6network6, libqt6widgets6, qt6-qpa-plugins, qt6-wayland, qt6-gtk-platformtheme, qt6-xdgdesktopportal-platformtheme, libxcb-cursor0, fonts-noto-color-emoji +Description: Qt based cross-platform GUI proxy configuration manager (backend: sing-box) +EOF + +cat >Throne/DEBIAN/postinst <<-EOF +cat >/usr/share/applications/Throne.desktop<<-END +[Desktop Entry] +Name=Throne +Comment=Qt based cross-platform GUI proxy configuration manager (backend: sing-box) +Exec=sh -c "PATH=/opt/Throne:\$PATH /opt/Throne/Throne -appdata" +Icon=/opt/Throne/Throne.png +Terminal=false +Type=Application +Categories=Network;Application; +END + +update-desktop-database +EOF + +chmod 0755 Throne/DEBIAN/postinst + +# desktop && PATH + +dpkg-deb --build Throne