Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Jan 31, 2023
1 parent afa2fc1 commit 064bd3e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 49 deletions.
62 changes: 17 additions & 45 deletions .github/workflows/build-qv2ray-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build-go:
strategy:
matrix:
cross_os: [ windows, linux, darwin ]
cross_os: [ windows, linux ]
cross_arch: [ amd64 ]
include:
- cross_os: public_res
Expand Down Expand Up @@ -58,15 +58,13 @@ jobs:
build-cpp:
strategy:
matrix:
platform: [ windows-2022, ubuntu-20.04, macos-10.15 ]
platform: [ windows-2022, ubuntu-20.04 ]
arch: [ x64 ]
fail-fast: false

runs-on: ${{ matrix.platform }}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
needs:
- build-go
steps:
- name: Checking out sources
uses: actions/checkout@v3
Expand All @@ -79,22 +77,7 @@ jobs:
# 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo
toolset: 14.2
arch: ${{ matrix.arch }}
- name: Download Artifacts for macOS
if: matrix.platform == 'macos-10.15'
uses: actions/download-artifact@v3
with:
path: download-artifact
# ========================================================================================================= Qt Install
- name: macOS - Install Qt 5.15
if: matrix.platform == 'macos-10.15'
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
py7zrversion: ' '
aqtversion: ' '
setup-python: false
cache: true
cache-key-prefix: QtCache-${{ matrix.platform }}-${{ matrix.arch }}
- name: Windows - Download Custom Qt 5.15 SDK
shell: bash
if: matrix.platform == 'windows-2022'
Expand All @@ -104,12 +87,6 @@ jobs:
7z x *.7z
rm *.7z
mv Qt* Qt
- name: Linux - Install Qt 5.12 via apt
shell: bash
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y zlib1g-dev fcitx-frontend-qt5 qtbase5-dev qttools5-dev libqt5svg5-dev libqt5x11extras5-dev
# ========================================================================================================= 编译与 Qt 无关的依赖
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
Expand All @@ -121,9 +98,18 @@ jobs:
key: DepsCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ hashFiles('libs/build_deps_*.sh') }}
- name: Build Dependencies
shell: bash
if: steps.cache-deps.outputs.cache-hit != 'true'
if: steps.cache-deps.outputs.cache-hit != 'true' && matrix.platform != 'ubuntu-20.04'
run: |
./libs/build_deps_all.sh
- name: Build Dependencies (Docker)
shell: bash
if: steps.cache-deps.outputs.cache-hit != 'true' && matrix.platform == 'ubuntu-20.04'
run: |
docker run --rm \
-v $PWD:/nekoray \
-w /nekoray \
ghcr.io/matsuridayo/debian10-qt5:20230131 \
bash -c "./libs/build_deps_all.sh"
# ========================================================================================================= Generate MakeFile and Build
- name: Windows - Generate MakeFile and Build
shell: bash
Expand All @@ -143,22 +129,11 @@ jobs:
shell: bash
if: matrix.platform == 'ubuntu-20.04'
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
ninja
cd ..
./libs/deploy_linux64.sh
- name: macOS - Generate MakeFile and Build
shell: bash
if: matrix.platform == 'macos-10.15'
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 ..
ninja
cd ..
./libs/deploy_macos.sh
docker run --rm \
-v $PWD:/nekoray \
-w /nekoray \
ghcr.io/matsuridayo/debian10-qt5:20230131 \
bash -c "mkdir build && pushd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. && ninja && popd &&./libs/deploy_linux64.sh"
# ========================================================================================================= Deployments
- name: Tar files
shell: bash
Expand Down Expand Up @@ -200,9 +175,6 @@ jobs:
mv windows64 nekoray
zip -r $version_standalone-windows64.zip nekoray
rm -rf nekoray
####
mv macos-amd64/nekoray.dmg $version_standalone-macos-amd64.dmg
rm -rf macos-amd64
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ https://matsuridayo.github.io

[Linux 运行教程](docs/Run_Linux.md)

## macOS

由于缺乏维护,不再提供 macOS 版本下载。最后包含 dmg 的版本是 2.12。

仍可以参照下方教程自行编译,常见问题请参考历史 Issue,欢迎 Pull Request 修复。

## 编译教程 / Compile Tutorial

[Linux](docs/Build_Linux.md)
Expand Down
3 changes: 2 additions & 1 deletion libs/deploy_linux64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ cp $USR_LIB/libQt5Svg.so.5 .
cp $USR_LIB/libQt5Widgets.so.5 .
cp $USR_LIB/libQt5X11Extras.so.5 .
cp $USR_LIB/libQt5XcbQpa.so.5 .
cp $USR_LIB/libxcb-util.so.1 .
cp $USR_LIB/libdouble-conversion.so.? .
cp $USR_LIB/libxcb-util.so.? .
cp $USR_LIB/libicuuc.so.?? .
cp $USR_LIB/libicui18n.so.?? .
cp $USR_LIB/libicudata.so.?? .
Expand Down
6 changes: 3 additions & 3 deletions ui/mainwindow_grpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ void MainWindow::setup_grpc() {
inline bool speedtesting = false;

void MainWindow::speedtest_current_group(int mode) {
if (speedtesting) return;
auto profiles = get_selected_or_group();
if (profiles.isEmpty()) return;
auto group = NekoRay::profileManager->CurrentGroup();
if (group->archive) return;

#ifndef NKR_NO_GRPC
if (speedtesting) return;
QStringList full_test_flags;
if (mode == libcore::FullTest) {
bool ok;
Expand All @@ -60,9 +61,8 @@ void MainWindow::speedtest_current_group(int mode) {
full_test_flags = s.trimmed().split(",");
if (!ok) return;
}

speedtesting = true;
#ifndef NKR_NO_GRPC

runOnNewThread([this, profiles, mode, full_test_flags]() {
QMutex lock_write;
QMutex lock_return;
Expand Down

0 comments on commit 064bd3e

Please sign in to comment.