mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +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:
|
||||
- cross_os: windows
|
||||
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_arch: amd64
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.25.1"
|
||||
- cross_os: linux
|
||||
cross_arch: arm64
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.25.1"
|
||||
- cross_os: darwin
|
||||
cross_arch: amd64
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.24.7"
|
||||
- cross_os: darwin
|
||||
cross_arch: arm64
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.25.1"
|
||||
- cross_os: windowslegacy
|
||||
cross_arch: amd64
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.25.1"
|
||||
- cross_os: windowslegacy
|
||||
cross_arch: 386
|
||||
go_version: "1.25.0"
|
||||
go_version: "1.25.1"
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@ -94,6 +97,9 @@ jobs:
|
||||
- platform: windows-latest
|
||||
qt_version: "6.9.0"
|
||||
target: x86_64
|
||||
- platform: windows-11-arm
|
||||
qt_version: "6.9.0"
|
||||
target: arm64
|
||||
- platform: ubuntu-22.04
|
||||
qt_version: "6.9.0"
|
||||
target: amd64
|
||||
@ -106,6 +112,9 @@ jobs:
|
||||
- platform: macos-latest
|
||||
qt_version: "6.9.0"
|
||||
target: arm64
|
||||
- platform: macos-latest
|
||||
qt_version: "6.4.3"
|
||||
target: x86_64
|
||||
- platform: windows-latest
|
||||
qt_version: "6.2.12"
|
||||
target: x86_64
|
||||
@ -127,6 +136,11 @@ jobs:
|
||||
uses: bwoodsend/setup-winlibs-action@v1.15
|
||||
with:
|
||||
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
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
@ -181,6 +195,17 @@ jobs:
|
||||
ninja -j2
|
||||
cd ..
|
||||
./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
|
||||
shell: cmd
|
||||
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
||||
@ -203,7 +228,7 @@ jobs:
|
||||
./script/deploy_linux64.sh
|
||||
- name: macOS - Generate MakeFile and Build
|
||||
shell: bash
|
||||
if: matrix.platform == 'macos-latest'
|
||||
if: matrix.platform == 'macos-latest' && matrix.qt_version != '6.4.3'
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
@ -212,6 +237,17 @@ jobs:
|
||||
ninja
|
||||
cd ..
|
||||
./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
|
||||
- name: Tar files
|
||||
shell: bash
|
||||
@ -272,6 +308,10 @@ jobs:
|
||||
zip -9 -r $version_standalone-windowslegacy64.zip Throne
|
||||
rm -rf Throne
|
||||
####
|
||||
mv windows-arm64 Throne
|
||||
zip -9 -r $version_standalone-windows-arm64.zip Throne
|
||||
rm -rf Throne
|
||||
####
|
||||
mkdir Throne
|
||||
mv macos-arm64/Throne.app Throne/Throne.app
|
||||
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
|
||||
rm -rf macos-amd64
|
||||
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
|
||||
run: |
|
||||
cd deployment
|
||||
@ -294,6 +340,7 @@ jobs:
|
||||
rm -rf windowslegacy64
|
||||
rm -rf macos-amd64
|
||||
rm -rf macos-arm64
|
||||
rm -rf macoslegacy-amd64
|
||||
rm -rf *.pdb
|
||||
- name: Uploading Artifact
|
||||
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 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);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -13,12 +13,7 @@ generate_product_version(
|
||||
)
|
||||
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
|
||||
set(GUI_TYPE WIN32)
|
||||
if (MINGW)
|
||||
if (NOT DEFINED MinGW_ROOT)
|
||||
set(MinGW_ROOT "C:/msys64/mingw64")
|
||||
endif ()
|
||||
else ()
|
||||
if (MSVC)
|
||||
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)
|
||||
endif ()
|
||||
|
||||
@ -58,27 +58,29 @@ func (s *server) Start(in *gen.LoadConfigReq, out *gen.ErrorResp) (_ error) {
|
||||
}
|
||||
|
||||
if *in.NeedExtraProcess {
|
||||
extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf"
|
||||
f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700)
|
||||
if e != nil {
|
||||
err = E.Cause(e, "Failed to open extra.conf")
|
||||
return
|
||||
}
|
||||
_, e = f.WriteString(*in.ExtraProcessConf)
|
||||
if e != nil {
|
||||
err = E.Cause(e, "Failed to write extra.conf")
|
||||
return
|
||||
}
|
||||
_ = f.Close()
|
||||
args, e := shlex.Split(*in.ExtraProcessArgs)
|
||||
args, e := shlex.Split(in.GetExtraProcessArgs())
|
||||
if e != nil {
|
||||
err = E.Cause(e, "Failed to parse args")
|
||||
return
|
||||
}
|
||||
for idx, arg := range args {
|
||||
if strings.Contains(arg, "%s") {
|
||||
args[idx] = fmt.Sprintf(arg, extraConfPath)
|
||||
break
|
||||
if in.ExtraProcessConf != nil {
|
||||
extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf"
|
||||
f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700)
|
||||
if e != nil {
|
||||
err = E.Cause(e, "Failed to open extra.conf")
|
||||
return
|
||||
}
|
||||
_, e = f.WriteString(*in.ExtraProcessConf)
|
||||
if e != nil {
|
||||
err = E.Cause(e, "Failed to write extra.conf")
|
||||
return
|
||||
}
|
||||
_ = f.Close()
|
||||
for idx, arg := range args {
|
||||
if strings.Contains(arg, "%s") {
|
||||
args[idx] = fmt.Sprintf(arg, extraConfPath)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
set -e
|
||||
|
||||
source script/env_deploy.sh
|
||||
if [[ $1 == 'arm64' ]]; then
|
||||
ARCH="arm64"
|
||||
DEST=$DEPLOYMENT/macos-arm64
|
||||
else
|
||||
ARCH="amd64"
|
||||
if [[ $1 == 'x86_64' ]]; then
|
||||
DEST=$DEPLOYMENT/macos-amd64
|
||||
else
|
||||
DEST=$DEPLOYMENT/macoslegacy-amd64
|
||||
fi
|
||||
fi
|
||||
|
||||
source script/env_deploy.sh
|
||||
DEST=$DEPLOYMENT/macos-$ARCH
|
||||
rm -rf $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,21 +2358,25 @@ bool isNewer(QString assetName) {
|
||||
|
||||
void MainWindow::CheckUpdate() {
|
||||
QString search;
|
||||
#ifdef Q_OS_WIN32
|
||||
# ifdef Q_OS_WIN64
|
||||
if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809))
|
||||
search = "windows64";
|
||||
else
|
||||
search = "windowslegacy64";
|
||||
#ifdef Q_OS_WIN
|
||||
# ifdef Q_PROCESSOR_ARM_64
|
||||
search = "windows-arm64";
|
||||
# else
|
||||
search = "windows32";
|
||||
# ifdef Q_OS_WIN64
|
||||
if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809))
|
||||
search = "windows64";
|
||||
else
|
||||
search = "windowslegacy64";
|
||||
# else
|
||||
search = "windows32";
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef Q_OS_LINUX
|
||||
# ifdef Q_PROCESSOR_X86_64
|
||||
search = "linux-amd64";
|
||||
search = "linux-amd64";
|
||||
# else
|
||||
search = "linux-arm64";
|
||||
search = "linux-arm64";
|
||||
# endif
|
||||
#endif
|
||||
#ifdef Q_OS_MACOS
|
||||
|
||||
Loading…
Reference in New Issue
Block a user