mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
ci: add legacy windows build
This commit is contained in:
parent
af1b0c05b5
commit
c80eb7118e
61
.github/workflows/build.yml
vendored
61
.github/workflows/build.yml
vendored
@ -33,6 +33,12 @@ jobs:
|
|||||||
- cross_os: darwin
|
- cross_os: darwin
|
||||||
cross_arch: arm64
|
cross_arch: arm64
|
||||||
go_version: "1.24.4"
|
go_version: "1.24.4"
|
||||||
|
- cross_os: windowslegacy
|
||||||
|
cross_arch: amd64
|
||||||
|
go_version: "1.24.4"
|
||||||
|
- cross_os: windowslegacy
|
||||||
|
cross_arch: 386
|
||||||
|
go_version: "1.24.4"
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@ -52,9 +58,16 @@ jobs:
|
|||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
core/server/go.sum
|
core/server/go.sum
|
||||||
core/updater/go.sum
|
core/updater/go.sum
|
||||||
|
- name: Install Golang For Legacy Windows
|
||||||
|
if: matrix.cross_os == 'windowslegacy'
|
||||||
|
run: |
|
||||||
|
curl -L -o go.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/go.7z
|
||||||
|
7z x go.7z
|
||||||
- name: Install Protoc
|
- name: Install Protoc
|
||||||
|
if: matrix.cross_os != 'public_res'
|
||||||
uses: arduino/setup-protoc@v3
|
uses: arduino/setup-protoc@v3
|
||||||
- name: Installing protoc-gen-go
|
- name: Installing protoc-gen-go
|
||||||
|
if: matrix.cross_os != 'public_res'
|
||||||
run: |
|
run: |
|
||||||
go install github.com/golang/protobuf/protoc-gen-go@latest
|
go install github.com/golang/protobuf/protoc-gen-go@latest
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
@ -83,7 +96,11 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- platform: windows-latest
|
- platform: windows-latest
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
|
<<<<<<< HEAD
|
||||||
target: amd64
|
target: amd64
|
||||||
|
=======
|
||||||
|
target: x86_64
|
||||||
|
>>>>>>> origin/windows-legacy
|
||||||
- platform: ubuntu-22.04
|
- platform: ubuntu-22.04
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
target: amd64
|
target: amd64
|
||||||
@ -96,6 +113,12 @@ jobs:
|
|||||||
- platform: macos-latest
|
- platform: macos-latest
|
||||||
qt_version: "6.9.0"
|
qt_version: "6.9.0"
|
||||||
target: arm64
|
target: arm64
|
||||||
|
- platform: windows-latest
|
||||||
|
qt_version: "6.2.12"
|
||||||
|
target: x86_64
|
||||||
|
- platform: windows-latest
|
||||||
|
qt_version: "6.2.12"
|
||||||
|
target: i686
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
env:
|
env:
|
||||||
@ -109,6 +132,8 @@ jobs:
|
|||||||
- name: Install mingw
|
- name: Install mingw
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest'
|
||||||
uses: bwoodsend/setup-winlibs-action@v1.15
|
uses: bwoodsend/setup-winlibs-action@v1.15
|
||||||
|
with:
|
||||||
|
architecture: ${{ matrix.target }}
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v4.3.0
|
uses: actions/download-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
@ -116,14 +141,14 @@ jobs:
|
|||||||
# ========================================================================================================= Qt Install
|
# ========================================================================================================= Qt Install
|
||||||
- name: Qt static Cache
|
- name: Qt static Cache
|
||||||
id: cache-static-Qt
|
id: cache-static-Qt
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
||||||
uses: actions/cache@v4.2.3
|
uses: actions/cache@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: qt6/build
|
path: qt6/build
|
||||||
key: QtStaticCache-${{ matrix.platform }}-${{ matrix.target }}-Qt${{ matrix.qt_version }}
|
key: QtStaticCache-${{ matrix.platform }}-${{ matrix.target }}-Qt${{ matrix.qt_version }}
|
||||||
- name: Install Qt Windows
|
- name: Install Qt Windows
|
||||||
shell: powershell
|
shell: powershell
|
||||||
if: matrix.platform == 'windows-latest' && steps.cache-static-Qt.outputs.cache-hit != 'true'
|
if: matrix.platform == 'windows-latest' && steps.cache-static-Qt.outputs.cache-hit != 'true' && matrix.qt_version != '6.2.12'
|
||||||
run: ./script/build_qt_static_windows.bat ${{ matrix.qt_version }}
|
run: ./script/build_qt_static_windows.bat ${{ matrix.qt_version }}
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v4.3.0
|
uses: jurplel/install-qt-action@v4.3.0
|
||||||
@ -136,7 +161,7 @@ jobs:
|
|||||||
# ========================================================================================================= Generate MakeFile and Build
|
# ========================================================================================================= Generate MakeFile and Build
|
||||||
- name: Windows - Generate MakeFile and Build
|
- name: Windows - Generate MakeFile and Build
|
||||||
shell: bash
|
shell: bash
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
||||||
run: |
|
run: |
|
||||||
export CMAKE_PREFIX_PATH=$PWD/qt6/build/lib/cmake
|
export CMAKE_PREFIX_PATH=$PWD/qt6/build/lib/cmake
|
||||||
mkdir build
|
mkdir build
|
||||||
@ -144,10 +169,26 @@ jobs:
|
|||||||
cmake -GNinja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_BUILD_TYPE=Debug ..
|
cmake -GNinja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
ninja -j2
|
ninja -j2
|
||||||
cd ..
|
cd ..
|
||||||
./script/deploy_windows64.sh
|
./script/deploy_windows.sh
|
||||||
|
- name: Legacy Windows - Generate MakeFile and Build
|
||||||
|
shell: bash
|
||||||
|
if: matrix.platform == 'windows-latest' && matrix.qt_version == '6.2.12'
|
||||||
|
run: |
|
||||||
|
curl -L -o qt.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/qt-${{ matrix.target }}.7z
|
||||||
|
7z x qt.7z
|
||||||
|
curl -L -o openssl.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/openssl-${{ matrix.target }}.7z
|
||||||
|
7z x openssl.7z
|
||||||
|
export CMAKE_PREFIX_PATH=$PWD/Qt/lib/cmake
|
||||||
|
export OPENSSL_ROOT_DIR=$PWD/openssl
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -GNinja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
|
ninja -j2
|
||||||
|
cd ..
|
||||||
|
./script/deploy_windows.sh ${{ matrix.target }}
|
||||||
- name: Build Installer with NSIS
|
- name: Build Installer with NSIS
|
||||||
shell: cmd
|
shell: cmd
|
||||||
if: matrix.platform == 'windows-latest'
|
if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12'
|
||||||
run: |
|
run: |
|
||||||
cp .\script\windows_installer.nsi .
|
cp .\script\windows_installer.nsi .
|
||||||
makensis windows_installer.nsi
|
makensis windows_installer.nsi
|
||||||
@ -225,6 +266,14 @@ jobs:
|
|||||||
zip -9 -r $version_standalone-windows64.zip Throne
|
zip -9 -r $version_standalone-windows64.zip Throne
|
||||||
rm -rf Throne
|
rm -rf Throne
|
||||||
####
|
####
|
||||||
|
mv windows32 Throne
|
||||||
|
zip -9 -r $version_standalone-windows32.zip Throne
|
||||||
|
rm -rf Throne
|
||||||
|
####
|
||||||
|
mv windowslegacy64 Throne
|
||||||
|
zip -9 -r $version_standalone-windowslegacy64.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
|
||||||
@ -243,6 +292,8 @@ jobs:
|
|||||||
rm -rf linux-arm64
|
rm -rf linux-arm64
|
||||||
rm -rf linux-amd64
|
rm -rf linux-amd64
|
||||||
rm -rf windows64
|
rm -rf windows64
|
||||||
|
rm -rf windows32
|
||||||
|
rm -rf windowslegacy64
|
||||||
rm -rf macos-amd64
|
rm -rf macos-amd64
|
||||||
rm -rf macos-arm64
|
rm -rf macos-arm64
|
||||||
rm -rf public_res
|
rm -rf public_res
|
||||||
|
|||||||
@ -3,12 +3,25 @@ set -e
|
|||||||
|
|
||||||
source script/env_deploy.sh
|
source script/env_deploy.sh
|
||||||
[ "$GOOS" == "windows" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/windows64 || true
|
[ "$GOOS" == "windows" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/windows64 || true
|
||||||
|
[ "$GOOS" == "windows" ] && [ "$GOARCH" == "386" ] && DEST=$DEPLOYMENT/windows32 || true
|
||||||
[ "$GOOS" == "windows" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/windows-arm64 || true
|
[ "$GOOS" == "windows" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/windows-arm64 || true
|
||||||
[ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/linux-amd64 || true
|
[ "$GOOS" == "linux" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/linux-amd64 || true
|
||||||
[ "$GOOS" == "linux" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/linux-arm64 || true
|
[ "$GOOS" == "linux" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/linux-arm64 || true
|
||||||
[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/macos-amd64 || true
|
[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "amd64" ] && DEST=$DEPLOYMENT/macos-amd64 || true
|
||||||
[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/macos-arm64 || true
|
[ "$GOOS" == "darwin" ] && [ "$GOARCH" == "arm64" ] && DEST=$DEPLOYMENT/macos-arm64 || true
|
||||||
|
|
||||||
|
if [[ "$GOOS" == "windowslegacy" ]]; then
|
||||||
|
GOOS="windows"
|
||||||
|
GOCMD="$PWD/go/bin/go"
|
||||||
|
if [[ $GOARCH == 'amd64' ]]; then
|
||||||
|
DEST=$DEPLOYMENT/windowslegacy64
|
||||||
|
else
|
||||||
|
DEST=$DEPLOYMENT/windows32
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
GOCMD="go"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $DEST ]; then
|
if [ -z $DEST ]; then
|
||||||
echo "Please set GOOS GOARCH"
|
echo "Please set GOOS GOARCH"
|
||||||
exit 1
|
exit 1
|
||||||
@ -20,7 +33,7 @@ export CGO_ENABLED=0
|
|||||||
|
|
||||||
#### Go: updater ####
|
#### Go: updater ####
|
||||||
pushd core/updater
|
pushd core/updater
|
||||||
[ "$GOOS" == "darwin" ] || go build -o $DEST -trimpath -ldflags "-w -s"
|
[ "$GOOS" == "darwin" ] || $GOCMD build -o $DEST -trimpath -ldflags "-w -s"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#### Go: core ####
|
#### Go: core ####
|
||||||
@ -29,5 +42,5 @@ pushd gen
|
|||||||
protoc -I . --go_out=. --go_opt paths=source_relative --go-grpc_out=. --go-grpc_opt paths=source_relative libcore.proto
|
protoc -I . --go_out=. --go_opt paths=source_relative --go-grpc_out=. --go-grpc_opt paths=source_relative libcore.proto
|
||||||
popd
|
popd
|
||||||
VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box)
|
VERSION_SINGBOX=$(go list -m -f '{{.Version}}' github.com/sagernet/sing-box)
|
||||||
go build -v -o $DEST -trimpath -ldflags "-w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" -tags "with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_ech,with_dhcp"
|
$GOCMD build -v -o $DEST -trimpath -ldflags "-w -s -X 'github.com/sagernet/sing-box/constant.Version=${VERSION_SINGBOX}'" -tags "with_clash_api,with_gvisor,with_quic,with_wireguard,with_utls,with_ech,with_dhcp"
|
||||||
popd
|
popd
|
||||||
|
|||||||
@ -2,7 +2,18 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
source script/env_deploy.sh
|
source script/env_deploy.sh
|
||||||
DEST=$DEPLOYMENT/windows64
|
if [[ $1 == 'i686' ]]; then
|
||||||
|
ARCH="windowslegacy-386"
|
||||||
|
DEST=$DEPLOYMENT/windows32
|
||||||
|
else
|
||||||
|
if [[ $1 == 'x86_64' ]]; then
|
||||||
|
ARCH="windowslegacy-amd64"
|
||||||
|
DEST=$DEPLOYMENT/windowslegacy64
|
||||||
|
else
|
||||||
|
ARCH="windows-amd64"
|
||||||
|
DEST=$DEPLOYMENT/windows64
|
||||||
|
fi
|
||||||
|
fi
|
||||||
rm -rf $DEST
|
rm -rf $DEST
|
||||||
mkdir -p $DEST
|
mkdir -p $DEST
|
||||||
|
|
||||||
@ -21,7 +32,7 @@ mv Throne.pdb $DEST
|
|||||||
cp $BUILD/Throne.exe $DEST
|
cp $BUILD/Throne.exe $DEST
|
||||||
|
|
||||||
cd download-artifact
|
cd download-artifact
|
||||||
cd *windows-amd64
|
cd *$ARCH
|
||||||
tar xvzf artifacts.tgz -C ../../
|
tar xvzf artifacts.tgz -C ../../
|
||||||
cd ..
|
cd ..
|
||||||
cd *public_res
|
cd *public_res
|
||||||
@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include "3rdparty/WinCommander.hpp"
|
#include "3rdparty/WinCommander.hpp"
|
||||||
|
#include <sdkddkver.h>
|
||||||
|
#include <minwindef.h>
|
||||||
|
#include <winbase.h>
|
||||||
|
#include <VersionHelpers.h>
|
||||||
#else
|
#else
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
#include "include/sys/linux/LinuxCap.h"
|
#include "include/sys/linux/LinuxCap.h"
|
||||||
@ -2280,16 +2284,19 @@ void MainWindow::CheckUpdate() {
|
|||||||
QString search;
|
QString search;
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
# ifdef Q_OS_WIN64
|
# ifdef Q_OS_WIN64
|
||||||
search = "windows64";
|
if (IsWindows10OrGreater())
|
||||||
|
search = "windows64";
|
||||||
|
else
|
||||||
|
search = "windowslegacy64";
|
||||||
# else
|
# else
|
||||||
search = "windows32";
|
search = "windows32";
|
||||||
# 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";
|
||||||
# else
|
# else
|
||||||
search = "linux-arm64";
|
search = "linux-arm64";
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user