diff --git a/.github/workflows/build-qv2ray-cmake.yml b/.github/workflows/build-qv2ray-cmake.yml index 7784650..9cd5b7f 100644 --- a/.github/workflows/build-qv2ray-cmake.yml +++ b/.github/workflows/build-qv2ray-cmake.yml @@ -194,13 +194,17 @@ jobs: path: download-artifact - name: Pack run: | - curl -Lo - https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz | tar xzv + curl -Lo - https://github.com/tcnksm/ghr/releases/download/v0.16.2/ghr_v0.16.2_linux_amd64.tar.gz | tar xzv mv ghr*linux_amd64/ghr . source libs/env_deploy.sh find . -name artifacts.tgz | xargs -n1 tar xvzf cd deployment rm -rf *.pdb #### + bash ../libs/pack_debian.sh ${{ github.event.inputs.tag }} + mv nekoray.deb $version_standalone-debian-x64.deb + rm -rf nekoray + #### mv linux64 nekoray zip -r $version_standalone-linux64.zip nekoray rm -rf nekoray diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bdd3cd..410698e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ list(APPEND NKR_EXTERNAL_TARGETS ZXing::ZXing) include(FetchContent) FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git - GIT_TAG b5a21decc0cf25773fb5d742101da6b72639aa51) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases + GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases FetchContent_MakeAvailable(cpr) list(APPEND NKR_EXTERNAL_TARGETS cpr::cpr) diff --git a/libs/pack_debian.sh b/libs/pack_debian.sh new file mode 100644 index 0000000..16924fb --- /dev/null +++ b/libs/pack_debian.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +version="$1" + +mkdir -p nekoray/DEBIAN +mkdir -p nekoray/opt +cp -r linux64 nekoray/opt/ +mv nekoray/opt/linux64 nekoray/opt/nekoray +rm -rf nekoray/opt/nekoray/usr +rm nekoray/opt/nekoray/launcher + +# basic +cat >nekoray/DEBIAN/control <<-EOF +Package: nekoray +Version: $version +Architecture: amd64 +Maintainer: Mahdi Mahdi.zrei@gmail.com +Depends: libxcb-util1, libqt6core6, libqt6dbus6, libqt6gui6, libqt6network6, libqt6widgets6, libqt6svg6, libicu72, libxcb-cursor0, desktop-file-utils +Description: Qt based cross-platform GUI proxy configuration manager (backend: sing-box) +EOF + +cat >nekoray/DEBIAN/postinst <<-EOF +if [ ! -s /usr/share/applications/nekoray.desktop ]; then + cat >/usr/share/applications/nekoray.desktop<<-END +[Desktop Entry] +Name=nekoray +Comment=Qt based cross-platform GUI proxy configuration manager (backend: sing-box) +Exec=sh -c "PATH=/opt/nekoray:\$PATH /opt/nekoray/nekobox -appdata" +Icon=/opt/nekoray/nekobox.png +Terminal=false +Type=Application +Categories=Network;Application; +END +fi + +setcap cap_net_admin=ep /opt/nekoray/nekobox_core + +update-desktop-database +EOF + +sudo chmod 0755 nekoray/DEBIAN/postinst + +# desktop && PATH + +sudo dpkg-deb -Zxz --build nekoray \ No newline at end of file