feat: Add deb release

This commit is contained in:
unknown 2024-07-26 23:48:30 +03:30
parent 73fd1bfc1e
commit a85dc6fc41
No known key found for this signature in database
GPG Key ID: C2CA486E4F771093
3 changed files with 52 additions and 2 deletions

View File

@ -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

View File

@ -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)

46
libs/pack_debian.sh Normal file
View File

@ -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