mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
Merge branch 'throneproj:dev' into dev
This commit is contained in:
commit
2f3fa2c38f
63
.github/workflows/build.yml
vendored
63
.github/workflows/build.yml
vendored
@ -17,25 +17,28 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- cross_os: windows
|
- cross_os: windows
|
||||||
cross_arch: amd64
|
cross_arch: amd64
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
|
- cross_os: windows
|
||||||
|
cross_arch: arm64
|
||||||
|
go_version: "1.25.1"
|
||||||
- cross_os: linux
|
- cross_os: linux
|
||||||
cross_arch: amd64
|
cross_arch: amd64
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
- cross_os: linux
|
- cross_os: linux
|
||||||
cross_arch: arm64
|
cross_arch: arm64
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
- cross_os: darwin
|
- cross_os: darwin
|
||||||
cross_arch: amd64
|
cross_arch: amd64
|
||||||
go_version: "1.25.0"
|
go_version: "1.24.7"
|
||||||
- cross_os: darwin
|
- cross_os: darwin
|
||||||
cross_arch: arm64
|
cross_arch: arm64
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
- cross_os: windowslegacy
|
- cross_os: windowslegacy
|
||||||
cross_arch: amd64
|
cross_arch: amd64
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
- cross_os: windowslegacy
|
- cross_os: windowslegacy
|
||||||
cross_arch: 386
|
cross_arch: 386
|
||||||
go_version: "1.25.0"
|
go_version: "1.25.1"
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -94,6 +97,9 @@ jobs:
|
|||||||
- platform: windows-latest
|
- platform: windows-latest
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
target: x86_64
|
target: x86_64
|
||||||
|
- platform: windows-11-arm
|
||||||
|
qt_version: "6.9.0"
|
||||||
|
target: arm64
|
||||||
- platform: ubuntu-22.04
|
- platform: ubuntu-22.04
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
target: amd64
|
target: amd64
|
||||||
@ -106,6 +112,9 @@ jobs:
|
|||||||
- platform: macos-latest
|
- platform: macos-latest
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
target: arm64
|
target: arm64
|
||||||
|
- platform: macos-latest
|
||||||
|
qt_version: "6.4.3"
|
||||||
|
target: x86_64
|
||||||
- platform: windows-latest
|
- platform: windows-latest
|
||||||
qt_version: "6.2.12"
|
qt_version: "6.2.12"
|
||||||
target: x86_64
|
target: x86_64
|
||||||
@ -127,6 +136,11 @@ jobs:
|
|||||||
uses: bwoodsend/setup-winlibs-action@v1.15
|
uses: bwoodsend/setup-winlibs-action@v1.15
|
||||||
with:
|
with:
|
||||||
architecture: ${{ matrix.target }}
|
architecture: ${{ matrix.target }}
|
||||||
|
- name: Install MSVC compiler
|
||||||
|
if: matrix.platform == 'windows-11-arm'
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
with:
|
||||||
|
arch: arm64
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v4.3.0
|
uses: actions/download-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
@ -181,6 +195,17 @@ jobs:
|
|||||||
ninja -j2
|
ninja -j2
|
||||||
cd ..
|
cd ..
|
||||||
./script/deploy_windows.sh ${{ matrix.target }}
|
./script/deploy_windows.sh ${{ matrix.target }}
|
||||||
|
- name: WOA - Generate MakeFile and Build
|
||||||
|
shell: bash
|
||||||
|
if: matrix.platform == 'windows-11-arm'
|
||||||
|
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 ..
|
||||||
|
ninja -j2
|
||||||
|
cd ..
|
||||||
|
./script/deploy_woa.sh
|
||||||
- name: Build Installer with NSIS
|
- name: Build Installer with NSIS
|
||||||
shell: cmd
|
shell: cmd
|
||||||
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
||||||
@ -203,7 +228,7 @@ jobs:
|
|||||||
./script/deploy_linux64.sh
|
./script/deploy_linux64.sh
|
||||||
- name: macOS - Generate MakeFile and Build
|
- name: macOS - Generate MakeFile and Build
|
||||||
shell: bash
|
shell: bash
|
||||||
if: matrix.platform == 'macos-latest'
|
if: matrix.platform == 'macos-latest' && matrix.qt_version != '6.4.3'
|
||||||
run: |
|
run: |
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
@ -212,6 +237,17 @@ jobs:
|
|||||||
ninja
|
ninja
|
||||||
cd ..
|
cd ..
|
||||||
./script/deploy_macos.sh ${{ matrix.target }}
|
./script/deploy_macos.sh ${{ matrix.target }}
|
||||||
|
- name: Legacy macOS - Generate MakeFile and Build
|
||||||
|
shell: bash
|
||||||
|
if: matrix.platform == 'macos-latest' && matrix.qt_version == '6.4.3'
|
||||||
|
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 -DNKR_PACKAGE_MACOS=1 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=${{ matrix.target }} ..
|
||||||
|
ninja
|
||||||
|
cd ..
|
||||||
|
./script/deploy_macos.sh
|
||||||
# ========================================================================================================= Deployments
|
# ========================================================================================================= Deployments
|
||||||
- name: Tar files
|
- name: Tar files
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -272,6 +308,10 @@ jobs:
|
|||||||
zip -9 -r $version_standalone-windowslegacy64.zip Throne
|
zip -9 -r $version_standalone-windowslegacy64.zip Throne
|
||||||
rm -rf Throne
|
rm -rf Throne
|
||||||
####
|
####
|
||||||
|
mv windows-arm64 Throne
|
||||||
|
zip -9 -r $version_standalone-windows-arm64.zip Throne
|
||||||
|
rm -rf Throne
|
||||||
|
####
|
||||||
mkdir Throne
|
mkdir Throne
|
||||||
mv macos-arm64/Throne.app Throne/Throne.app
|
mv macos-arm64/Throne.app Throne/Throne.app
|
||||||
zip -9 --symlinks -r $version_standalone-macos-arm64.zip Throne
|
zip -9 --symlinks -r $version_standalone-macos-arm64.zip Throne
|
||||||
@ -283,6 +323,12 @@ jobs:
|
|||||||
zip -9 --symlinks -r $version_standalone-macos-amd64.zip Throne
|
zip -9 --symlinks -r $version_standalone-macos-amd64.zip Throne
|
||||||
rm -rf macos-amd64
|
rm -rf macos-amd64
|
||||||
rm -rf Throne
|
rm -rf Throne
|
||||||
|
####
|
||||||
|
mkdir Throne
|
||||||
|
mv macoslegacy-amd64/Throne.app Throne/Throne.app
|
||||||
|
zip -9 --symlinks -r $version_standalone-macoslegacy-amd64.zip Throne
|
||||||
|
rm -rf macoslegacy-amd64
|
||||||
|
rm -rf Throne
|
||||||
- name: Clean Up
|
- name: Clean Up
|
||||||
run: |
|
run: |
|
||||||
cd deployment
|
cd deployment
|
||||||
@ -294,6 +340,7 @@ jobs:
|
|||||||
rm -rf windowslegacy64
|
rm -rf windowslegacy64
|
||||||
rm -rf macos-amd64
|
rm -rf macos-amd64
|
||||||
rm -rf macos-arm64
|
rm -rf macos-arm64
|
||||||
|
rm -rf macoslegacy-amd64
|
||||||
rm -rf *.pdb
|
rm -rf *.pdb
|
||||||
- name: Uploading Artifact
|
- name: Uploading Artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v4.6.2
|
||||||
|
|||||||
@ -124,7 +124,7 @@ namespace Qv2ray::ui::widgets {
|
|||||||
const bool isTab = (e->modifiers().testFlag(Qt::NoModifier) && e->key() == Qt::Key_Tab);
|
const bool isTab = (e->modifiers().testFlag(Qt::NoModifier) && e->key() == Qt::Key_Tab);
|
||||||
const bool isOtherSpace = e->text() == " ";
|
const bool isOtherSpace = e->text() == " ";
|
||||||
//
|
//
|
||||||
if (isSpace || isTab || isOtherSpace) {
|
if (isSpace && !lineUnderCursor().startsWith("processName:") && !lineUnderCursor().startsWith("processPath:") || isTab || isOtherSpace) {
|
||||||
QToolTip::showText(this->mapToGlobal(QPoint(0, 0)), tr("You can not input space characters here."), this, QRect{}, 2000);
|
QToolTip::showText(this->mapToGlobal(QPoint(0, 0)), tr("You can not input space characters here."), this, QRect{}, 2000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,12 +13,7 @@ generate_product_version(
|
|||||||
)
|
)
|
||||||
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
|
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
|
||||||
set(GUI_TYPE WIN32)
|
set(GUI_TYPE WIN32)
|
||||||
if (MINGW)
|
if (MSVC)
|
||||||
if (NOT DEFINED MinGW_ROOT)
|
|
||||||
set(MinGW_ROOT "C:/msys64/mingw64")
|
|
||||||
endif ()
|
|
||||||
else ()
|
|
||||||
add_compile_options("/utf-8")
|
add_compile_options("/utf-8")
|
||||||
add_compile_options("/std:c++17")
|
|
||||||
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@ -58,6 +58,12 @@ func (s *server) Start(in *gen.LoadConfigReq, out *gen.ErrorResp) (_ error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if *in.NeedExtraProcess {
|
if *in.NeedExtraProcess {
|
||||||
|
args, e := shlex.Split(in.GetExtraProcessArgs())
|
||||||
|
if e != nil {
|
||||||
|
err = E.Cause(e, "Failed to parse args")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if in.ExtraProcessConf != nil {
|
||||||
extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf"
|
extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf"
|
||||||
f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700)
|
f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
@ -70,17 +76,13 @@ func (s *server) Start(in *gen.LoadConfigReq, out *gen.ErrorResp) (_ error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_ = f.Close()
|
_ = f.Close()
|
||||||
args, e := shlex.Split(*in.ExtraProcessArgs)
|
|
||||||
if e != nil {
|
|
||||||
err = E.Cause(e, "Failed to parse args")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for idx, arg := range args {
|
for idx, arg := range args {
|
||||||
if strings.Contains(arg, "%s") {
|
if strings.Contains(arg, "%s") {
|
||||||
args[idx] = fmt.Sprintf(arg, extraConfPath)
|
args[idx] = fmt.Sprintf(arg, extraConfPath)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extraProcess = process.NewProcess(*in.ExtraProcessPath, args, *in.ExtraNoOut)
|
extraProcess = process.NewProcess(*in.ExtraProcessPath, args, *in.ExtraNoOut)
|
||||||
err = extraProcess.Start()
|
err = extraProcess.Start()
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
source script/env_deploy.sh
|
|
||||||
DEST=$DEPLOYMENT/public_res
|
|
||||||
rm -rf $DEST
|
|
||||||
mkdir -p $DEST
|
|
||||||
|
|
||||||
#### Download geodata ####
|
|
||||||
curl -fLso $DEST/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
|
||||||
curl -fLso $DEST/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
|
||||||
@ -1,14 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source script/env_deploy.sh
|
||||||
if [[ $1 == 'arm64' ]]; then
|
if [[ $1 == 'arm64' ]]; then
|
||||||
ARCH="arm64"
|
ARCH="arm64"
|
||||||
|
DEST=$DEPLOYMENT/macos-arm64
|
||||||
else
|
else
|
||||||
ARCH="amd64"
|
ARCH="amd64"
|
||||||
|
if [[ $1 == 'x86_64' ]]; then
|
||||||
|
DEST=$DEPLOYMENT/macos-amd64
|
||||||
|
else
|
||||||
|
DEST=$DEPLOYMENT/macoslegacy-amd64
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source script/env_deploy.sh
|
|
||||||
DEST=$DEPLOYMENT/macos-$ARCH
|
|
||||||
rm -rf $DEST
|
rm -rf $DEST
|
||||||
mkdir -p $DEST
|
mkdir -p $DEST
|
||||||
|
|
||||||
|
|||||||
22
script/deploy_woa.sh
Executable file
22
script/deploy_woa.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
source script/env_deploy.sh
|
||||||
|
DEST=$DEPLOYMENT/windows-arm64
|
||||||
|
rm -rf $DEST
|
||||||
|
mkdir -p $DEST
|
||||||
|
|
||||||
|
#### copy exe ####
|
||||||
|
cp $BUILD/Throne.exe $DEST
|
||||||
|
|
||||||
|
cd download-artifact
|
||||||
|
cd *windows-arm64
|
||||||
|
tar xvzf artifacts.tgz -C ../../
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
#### deploy qt & DLL runtime ####
|
||||||
|
pushd $DEST
|
||||||
|
windeployqt Throne.exe --no-translations --no-system-d3d-compiler --no-opengl-sw --no-svg --verbose 2
|
||||||
|
popd
|
||||||
|
|
||||||
|
rm -rf $DEST/dxcompiler.dll $DEST/dxil.dll
|
||||||
@ -2358,7 +2358,10 @@ bool isNewer(QString assetName) {
|
|||||||
|
|
||||||
void MainWindow::CheckUpdate() {
|
void MainWindow::CheckUpdate() {
|
||||||
QString search;
|
QString search;
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN
|
||||||
|
# ifdef Q_PROCESSOR_ARM_64
|
||||||
|
search = "windows-arm64";
|
||||||
|
# else
|
||||||
# ifdef Q_OS_WIN64
|
# ifdef Q_OS_WIN64
|
||||||
if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809))
|
if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809))
|
||||||
search = "windows64";
|
search = "windows64";
|
||||||
@ -2368,6 +2371,7 @@ void MainWindow::CheckUpdate() {
|
|||||||
search = "windows32";
|
search = "windows32";
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
# ifdef Q_PROCESSOR_X86_64
|
# ifdef Q_PROCESSOR_X86_64
|
||||||
search = "linux-amd64";
|
search = "linux-amd64";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user