Skip to content

Commit

Permalink
use Qt5.15 for win7
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed May 22, 2023
1 parent c5122b7 commit 68fecb7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 20 deletions.
50 changes: 33 additions & 17 deletions .github/workflows/build-qv2ray-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ jobs:
build-cpp:
strategy:
matrix:
platform: [ windows-2022, ubuntu-20.04 ]
arch: [ x64 ]
include:
- platform: windows-2022
arch: x64
qt_version: "5.15"
- platform: windows-2022
arch: x64
qt_version: "6.5"
- platform: ubuntu-20.04
arch: x64
qt_version: "5.12"
fail-fast: false

runs-on: ${{ matrix.platform }}
Expand All @@ -78,15 +86,12 @@ jobs:
toolset: 14.2
arch: ${{ matrix.arch }}
# ========================================================================================================= Qt Install
- name: Windows - Download Custom Qt 5.15 SDK
- name: Windows - Download Custom Qt ${{ matrix.qt_version }} SDK
shell: bash
if: matrix.platform == 'windows-2022'
run: |
mkdir qtsdk ; cd qtsdk
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z
7z x *.7z
rm *.7z
mv Qt* Qt
env:
DL_QT_VER: ${{ matrix.qt_version }}
run: bash ./libs/download_qtsdk_win.sh
# ========================================================================================================= 编译与 Qt 无关的依赖
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
Expand All @@ -95,12 +100,11 @@ jobs:
uses: actions/cache@v3
with:
path: libs/deps
key: DepsCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ hashFiles('libs/build_deps_*.sh') }}
key: DepsCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ hashFiles('libs/build_deps_*.sh') }}-Qt${{ matrix.qt_version }}
- name: Build Dependencies
shell: bash
if: steps.cache-deps.outputs.cache-hit != 'true' && matrix.platform != 'ubuntu-20.04'
run: |
./libs/build_deps_all.sh
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'
Expand All @@ -115,13 +119,18 @@ jobs:
shell: bash
if: matrix.platform == 'windows-2022'
env:
DL_QT_VER: ${{ matrix.qt_version }}
CC: cl.exe
CXX: cl.exe
run: |
source libs/env_qtsdk.sh $PWD/qtsdk/Qt
mkdir build
cd build
cmake -GNinja -DQT_VERSION_MAJOR=6 -DCMAKE_BUILD_TYPE=Release ..
if [ "$DL_QT_VER" == "5.15" ]; then
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
else
cmake -GNinja -DQT_VERSION_MAJOR=6 -DCMAKE_BUILD_TYPE=Release ..
fi
ninja
cd ..
./libs/deploy_windows64.sh
Expand All @@ -141,7 +150,7 @@ jobs:
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:
name: NekoRay-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.arch }}
name: NekoRay-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.arch }}-Qt${{ matrix.qt_version }}
path: artifacts.tgz
publish:
name: Pack & Publish Release
Expand All @@ -167,6 +176,9 @@ jobs:
cd deployment
cp -r public_res/* linux64
cp -r public_res/* windows64
cp -r public_res/* windows7-x64
cp windows64/neko*core.exe windows7-x64
cp windows64/updater.exe windows7-x64
rm -rf public_res *.pdb
####
mv linux64 nekoray
Expand All @@ -176,15 +188,17 @@ jobs:
mv windows64 nekoray
zip -r $version_standalone-windows64.zip nekoray
rm -rf nekoray
####
mv windows7-x64 nekoray
zip -r $version_standalone-windows7-x64.zip nekoray
rm -rf nekoray
- name: Pack Debian
if: github.event.inputs.publish != 'y'
run: |
source libs/deploy_common.sh
find . -name artifacts.tgz | xargs -n1 tar xvzf
cd deployment
cp -r public_res/* linux64
cp -r public_res/* windows64
rm -rf public_res *.pdb
####
bash ../libs/package_debian.sh ${{ github.event.inputs.tag }}
mv nekoray.deb $version_standalone-debian-x64.deb
Expand All @@ -195,7 +209,6 @@ jobs:
find . -name artifacts.tgz | xargs -n1 tar xvzf
cd deployment
cp -r public_res/* linux64
rm -rf public_res *.pdb
####
bash ../libs/package_appimage.sh
mv nekoray-x86_64.AppImage $version_standalone-linux-x64.AppImage
Expand All @@ -204,6 +217,9 @@ jobs:
cd deployment
rm -rf linux64
rm -rf windows64
rm -rf windows7-x64
rm -rf public_res
rm -rf *.pdb
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:
Expand Down
4 changes: 4 additions & 0 deletions go/grpc_server/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (s *BaseServer) Update(ctx context.Context, in *gen.UpdateReq) (*gen.Update
var search string
if runtime.GOOS == "windows" && runtime.GOARCH == "amd64" {
search = "windows64"
// check Qt5 update after nekoray v3.3
if _, err := os.Stat("../Qt5Core.dll"); err == nil {
search = "windows7-x64"
}
} else if runtime.GOOS == "linux" && runtime.GOARCH == "amd64" {
search = "linux64"
} else if runtime.GOOS == "darwin" {
Expand Down
14 changes: 11 additions & 3 deletions libs/deploy_windows64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
set -e

source libs/deploy_common.sh
DEST=$DEPLOYMENT/windows64
if [ "$DL_QT_VER" == "5.15" ]; then
DEST=$DEPLOYMENT/windows7-x64
else
DEST=$DEPLOYMENT/windows64
fi
rm -rf $DEST
mkdir -p $DEST

Expand All @@ -14,8 +18,12 @@ pushd $DEST
windeployqt nekoray.exe --no-compiler-runtime --no-system-d3d-compiler --no-opengl-sw --verbose 2
rm -rf translations
rm -rf libEGL.dll libGLESv2.dll Qt6Pdf.dll
curl -fLSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/libcrypto-3-x64.dll
curl -fLSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/libssl-3-x64.dll

if [ "$DL_QT_VER" != "5.15" ]; then
curl -fLSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/libcrypto-3-x64.dll
curl -fLSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/libssl-3-x64.dll
fi

popd

#### prepare deployment ####
Expand Down
10 changes: 10 additions & 0 deletions libs/download_qtsdk_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
mkdir qtsdk
cd qtsdk
if [ "$DL_QT_VER" == "5.15" ]; then
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt5.15.7-Windows-x86_64-VS2019-16.11.20-20221103.7z
else
curl -LSO https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z
fi
7z x *.7z
rm *.7z
mv Qt* Qt

0 comments on commit 68fecb7

Please sign in to comment.