From b95a65c2d795ced55aaaf2b933c7f63716aae436 Mon Sep 17 00:00:00 2001 From: Qv2ray Bot <59914293+Qv2ray@users.noreply.github.com> Date: Thu, 23 Jan 2020 16:06:29 +0800 Subject: [PATCH 1/3] fix: fixed legacy API issue --- Build.Counter | 2 +- Qv2ray.pro | 2 ++ src/components/QvKernelInteractions.cpp | 34 +++++++++++++++---------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Build.Counter b/Build.Counter index 90087661..6585a1d2 100644 --- a/Build.Counter +++ b/Build.Counter @@ -1 +1 @@ -3077 +3082 diff --git a/Qv2ray.pro b/Qv2ray.pro index 5af25e65..f852bda0 100644 --- a/Qv2ray.pro +++ b/Qv2ray.pro @@ -20,9 +20,11 @@ no_increase_build_number { write_file("Build.Counter", _BUILD_NUMBER) } +# Unix (Actually Linux only) prefix config. isEmpty(PREFIX) { PREFIX=/usr/local } +message("Qv2ray installation PREFIX="$$PREFIX) DEFINES += QT_DEPRECATED_WARNINGS QV2RAY_VERSION_STRING=\"\\\"v$${VERSION}\\\"\" QAPPLICATION_CLASS=QApplication diff --git a/src/components/QvKernelInteractions.cpp b/src/components/QvKernelInteractions.cpp index 86d76304..d99d1c87 100644 --- a/src/components/QvKernelInteractions.cpp +++ b/src/components/QvKernelInteractions.cpp @@ -260,23 +260,29 @@ namespace Qv2ray } #ifdef WITH_LIB_GRPCPP - //GetStatsRequest request; - //request.set_name(name.toStdString()); - //request.set_reset(false); - //GetStatsResponse response; - //ClientContext context; - //Status status = Stub->GetStats(&context, request, &response); - // - //if (!status.ok()) { - // LOG(MODULE_VCORE, "API call returns: " + QSTRN(status.error_code()) + " (" + QString::fromStdString(status.error_message()) + ")") - // apiFailedCounter++; - //} - //return response.stat().value(); - //LOG(MODULE_VCORE, "API RETURN: " + QString::number(data)) + GetStatsRequest request; + request.set_name(name.toStdString()); + request.set_reset(false); + GetStatsResponse response; + ClientContext context; + Status status = Stub->GetStats(&context, request, &response); + + if (!status.ok()) { + LOG(MODULE_VCORE, "API call returns: " + QSTRN(status.error_code()) + " (" + QString::fromStdString(status.error_message()) + ")") + apiFailedCounter++; + } + + auto data = response.stat().value(); #else auto data = GetStats(const_cast(name.toStdString().c_str()), 1000); - return data; + + if (data < 0) { + LOG(MODULE_VCORE, "API call returns: " + QSTRN(data)) + apiFailedCounter++; + } + #endif + return data; } // ------------------------------------------------------------- API FUNCTIONS -------------------------- long V2rayKernelInstance::getTagSpeedUp(const QString &tag) From 1ab7bb3cb71dfc1c8975cbb242440cc2b3cb4ab6 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:45:01 +0800 Subject: [PATCH 2/3] Translate /translations/en_US.ts in zh_CN (#273) translation completed for the source file '/translations/en_US.ts' on the 'zh_CN' language. --- translations/zh_CN.ts | 452 ++++++++++++++++++++++-------------------- 1 file changed, 242 insertions(+), 210 deletions(-) diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 3cff1fff..d8e5addd 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -1194,7 +1194,7 @@ There're no support of sharing configs other than vmess - 那里'不支持共享除vmess以外的配置 + 不支持共享除vmess以外的配置 @@ -1445,10 +1445,10 @@ PreferencesWindow - - - - + + + + Preferences 首选项 @@ -1460,14 +1460,16 @@ - - - - - - - - + + + + + + + + + + Enabled 已启用 @@ -1497,58 +1499,58 @@ en-US - + Log Level 日志等级 - + none 不使用 - + debug 调试 - + info 信息 - + warning 警告 - + error 错误 - + Config 配置 - + Subscription 订阅 - + Transparent Proxy 透明代理 - - + + Select 选择 - + Auto Connect 自动连接 @@ -1558,47 +1560,47 @@ 移除 - + Inbound Settings 入站设置 - + Listening Address 监听地址 - - + + HTTP HTTP - + SOCKS SOCKS - - + + Set System Proxy 设置系统代理 - + SOCKS Settings SOCKS 设置 - - - - + + + + Port 端口 - + UDP Support UDP 支持 @@ -1613,168 +1615,173 @@ 安装 - - - + + API Subsystem + API 子系统 + + + + + Authentication 身份验证 - - - + + + Username 用户名 - - - + + + Password 密码 - + HTTP Settings HTTP 设置 - + PAC Settings PAC 设置 - + The system proxy will be configured to use the PAC instead of HTTP and SOCKS. 系统代理将被配置为使用 PAC 而不是 HTTP 和 SOCKS。 - + Local IP for PAC PAC 本地 IP 地址 - + 127.0.0.1 127.0.0.1 - + Use Proxy 使用代理服务器 - + Import GFWList 导入 GFWList - + Mirror: Gitlab 镜像源:Gitlab - + Github GitHub - + Mirror: Pagure 镜像源:Pagure - + Mirror: Repo.or.cz 镜像源:Repo.or.cz - + Mirror: Bitbucket 镜像源:Bitbucket - + Mirror: TuxFamily 镜像源:TuxFamily - + GFWList File GFWList 文件 - + Download with System Proxy 使用系统代理下载 - + Go 开始 - + Edit PAC 编辑 PAC - + Open PAC Folder 打开 PAC 文件夹 - + PAC Access Path PAC 访问路径 - + Connection Settings 连接设置 - + General Connection Settings 常规连接设置 - + Enable Proxy 启用代理 - + Bypass Chinese Mainland 绕过中国大陆 - + API Port API 端口 - + Use Local DNS 使用本地 DNS - + Custom DNS List 自定义 DNS 列表 - + Forward Proxy 前置代理 - + Only simple config is supported. 只支持简单配置。 - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1787,32 +1794,32 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'WenQuanYi Micro Hei';"><br /></p></body></html> - + Type 类型 - + Socks SOCKS - + Host Address 主机地址 - + Network Toolbar Settings 网络工具栏设置 - + Apply Network Speed Bar UI Settings 应用网络速度栏界面设置 - + Items 项目 @@ -1837,196 +1844,196 @@ p, li { white-space: pre-wrap; } - + V2ray Settings V2ray 设置 - + Core Executable Path 核心可执行文件路径 - + V2ray Assets Directory V2ray 资源目录 - + Check V2ray Core Settings 检查 V2ray 核心设置 - + UDP Local IP UDP 本地IP - - + + - - - - + + + + - + Page Y Offset 第 Y 页偏移 - + Pages 页面 - + Lines - + This feature is not stable and no documentation is provided, please use it at your own risk! 此功能不够稳定,且暂无文档,使用时需自负风险! - + Text Style 文字样式 - + Font 字体 - - + + Bold 粗体 - - + + Italic 斜体 - + Size 大小 - + Color 颜色 - + A: A: - + R: R: - + G: G: - + B: B: - + ... ... - + Style 样式 - + Content 内容 - + Content Type 内容类型 - + Text/Tag 文本/标签 - + You can config how the network speed toolbar looks like in this panel 您可以设定网络速度工具栏在此面板中的外观 - + About 关于 - + Qv2ray Qv2ray - + Version: 版本: - + <html><head/><body><p><a href="https://www.gnu.org/licenses/gpl-3.0.txt"><span style=" text-decoration: underline; color:#2980b9;">GPLv3 (https://www.gnu.org/licenses/gpl-3.0.txt)</span></a></p></body></html> <html><head/><body><p><a href="https://www.gnu.org/licenses/gpl-3.0.txt"><span style=" text-decoration: underline; color:#2980b9;">GPLv3 (https://www.gnu.org/licenses/gpl-3.0.txt)</span></a></p></body></html> - + Official Repo: 官方仓库: - + <html><head/><body><p><a href="https://github.com/lhy0403/Qv2ray"><span style=" text-decoration: underline; color:#2980b9;">https://github.com/lhy0403/Qv2ray</span></a></p></body></html> <html><head/><body><p><a href="https://github.com/lhy0403/Qv2ray"><span style=" text-decoration: underline; color:#2980b9;">https://github.com/lhy0403/Qv2ray</span></a></p></body></html> - + License: 许可证: - + Built Time: 构建于: - + Ignore Next Version 忽略下个版本 - + Cancel 取消 - + About Qt 关于 Qt @@ -2036,28 +2043,28 @@ p, li { white-space: pre-wrap; } 使用暗色模式主题 - + Page - + Item(s) 项目 - - + + Enable tProxy Support 启用 tProxy 支持 - + If anything goes wrong after enabling this, please refer to issue #57 or the link below: 如果在启用之后出现任何错误,请参阅 Issue #57 或以下链接: - + to this path: 到此路径: @@ -2067,96 +2074,96 @@ p, li { white-space: pre-wrap; } Qv2ray 网络工具栏已禁用,仍在测试中。添加参数 --withNetworkToolbar 以启用。 - + Duplicated port numbers detected, please check the port number settings. 检测到重复的端口号,请检查端口号设置。 - + Open V2ray assets folder 打开 V2ray 资源文件夹 - + Open V2ray core file 打开 V2ray 核心文件 - + This will append capabilities to the V2ray executable. 这会将功能附加到 V2ray 可执行文件。 - + Qv2ray will copy your V2ray core to this path: Qv2ray 会将您的 V2ray 核心复制到以下路径: - + Qv2ray cannot copy one or both V2ray files from: Qv2ray 无法从以下位置复制一个或两个 V2ray 文件: - - + + Failed to setcap onto V2ray executable. You may need to run `setcap` manually. 无法将 Capcap 设置到 V2ray 可执行文件上。 您可能需要手动运行“ setcap”。 - + tProxy is not supported on macOS and Windows 在 macOS 和 Windows 上不支持 tProxy - + Dark Mode 深色模式 - + Please restart Qv2ray to fully apply this feature. 请重启 Qv2ray 以充分应用此功能。 - + Select GFWList in base64 选择 base64 格式的 GFWList - + Download GFWList 下载 GFWList - + Successfully downloaded GFWList. 下载 GFWList 成功。 - - + + Start with boot 开机启动 - - + + Failed to set auto start option. 无法设置自动启动选项。 - - + + V2ray Core Settings V2ray 核心设置 - + V2ray path configuration check passed. V2ray 路径配置检查通过。 - + Current version of V2ray is: V2ray 当前版本是: @@ -2460,69 +2467,62 @@ p, li { white-space: pre-wrap; } Qv2ray::QvKernelInterations::V2rayKernelInstance - + V2ray core executable not found. 找不到 V2ray 核心可执行文件。 - + V2ray core file cannot be opened, please ensure there's a file instead of a folder. V2ray 核心文件无法打开,请确保文件's 不是文件夹。 - + V2ray assets path is not valid. V2ray 资源路径无效。 - + No geoip.dat in assets path. 资源路径中没有 geoip.dat。 - + No geosite.dat in assets path. 资源路径中没有 geosite.dat。 - - + V2ray core failed with an exit code: V2ray核心失败,退出代码: - - V2ray core not responsed within 1 secs. - V2ray 核心未在 1 秒内响应. - - - - + Cannot start V2ray 无法启动 V2ray - + Configuration Error 配置错误 - + V2ray core settings is incorrect. V2ray 核心设置不正确。 - + The error is: 错误是: - + Failed to get statistics data, please check if V2ray is running properly 无法获取统计数据,请检查 V2ray 是否正常运行 - + API Call Failed API 调用失败 @@ -2556,7 +2556,7 @@ p, li { white-space: pre-wrap; } - + Route Editor 路由编辑器 @@ -2820,131 +2820,163 @@ p, li { white-space: pre-wrap; } 用户列表 - - - + + + OK - + Cannot Edit 无法编辑 - + This outbound entry is not supported by the GUI editor. 此出站条目不支持GUI编辑。 - - + + We will launch Json Editor instead. 我们将启动 Json 编辑器。 - - - + + Show rule details + 查看规则细节 + + + + A rule cannot be found: + 规则未找到: + + + + + Protocol list changed: 协议列表已更改: - + Balancer is empty, not processing. 负载均衡器列表是空的,不处理。 - + Default rule 默认规则 - + rule 规则 - + + No Inbound + 无入站 + + + + No inbound item found: + 入站项目未找到: + + + + + + The new tag has been used, we appended a postfix. + 原标签被占用,自动添加后缀。 + + + To make this rule ready to use, you need to connect it to an outbound node. 要使这条规则可以使用,您需要将它连接到一个出站节点。 - + Remove Items 移除项目 - - + + Please select a node from the graph to continue. 请从图表中选择要继续的节点。 - + Error 错误 - + Qv2ray entered an unknown state. Qv2ray 进入了未知状态 - + Edit Inbound/Outbound 编辑入站/出站 - - + + + Edit Inbound + 编辑入站 + + + + + No inbound tag found: + 入站标签未找到: + + + + Opening JSON editor 正在打开 JSON 编辑器 - + Unsupported Outbound Type 不支持的出站类型 - + Opening default outbound editor. 打开默认出站编辑器。 - + Added DIRECT outbound 已添加 DIRECT 出站 - + Currently, this type of outbound is not supported by the editor. 目前不支持此类型的出站 - + Opening default inbound editor 打开默认的入站编辑器 - + Removed a balancer entry. 删除了一个平衡条目。 - - - + + + Rename tags 重命名标签 - - - - - The new tag has been used, please suggest another. - 新标签名已被使用,请换个名称。 - ScreenShot From ed65532019fdb5a3aaab46e287a594c1234451f7 Mon Sep 17 00:00:00 2001 From: Qv2ray Bot <59914293+Qv2ray-Bot@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:45:37 +0800 Subject: [PATCH 3/3] V2 update action scripts (#274) * try new Github Action config * prevent using ":" * fix release string in yaml * fix cd build * fix cross platform build * enable prereleased build --- .github/workflows/Linux.yml | 117 ++++++++++++++++++ .github/workflows/Windows.yml | 111 +++++++++++++++++ .github/workflows/build-push.yml | 162 ------------------------ .github/workflows/build-release.yml | 183 ---------------------------- .github/workflows/macOS.yml | 87 +++++++++++++ 5 files changed, 315 insertions(+), 345 deletions(-) create mode 100644 .github/workflows/Linux.yml create mode 100644 .github/workflows/Windows.yml delete mode 100644 .github/workflows/build-push.yml delete mode 100644 .github/workflows/build-release.yml create mode 100644 .github/workflows/macOS.yml diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml new file mode 100644 index 00000000..2524e248 --- /dev/null +++ b/.github/workflows/Linux.yml @@ -0,0 +1,117 @@ +name: Qv2ray Push Build for Linux + +on: + push: + release: + types: [prereleased] + +jobs: +# =================================================================================== LINUX + Linux: + name: Push build for Linux + runs-on: ubuntu-16.04 + steps: + - name: Checking out sources + uses: actions/checkout@master + - name: Restoring submodules + run: git submodule update --init +# -------------------------------------------------------- + - name: Installing Qt + uses: jurplel/install-qt-action@v2 + with: + modules: qtcharts +# -------------------------------------------------------- + - name: Install Packages + run: | + sudo add-apt-repository ppa:webispy/grpc + sudo add-apt-repository ppa:carsten-uppenbrink-net/openssl + sudo apt update + sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc +# -------------------------------------------------------- + - name: Extracting gRPC and protobuf libs and headers + run: tools/grpc_gen.sh +# -------------------------------------------------------- + - name: Download libqvb static library. + uses: Legion2/download-release-action@v2.1.0 + with: + repository: Qv2ray/QvRPCBridge + tag: 'latest' + path: libs + file: libqvb-linux64.a +# -------------------------------------------------------- libqvb build + - name: libqvb - Build Qv2ray + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend PREFIX=/usr + make -j2 + - name: libqvb - Generating filesystem structure for AppImage + run: | + cd build + make install INSTALL_ROOT=AppDir + cd AppDir + mkdir -p ./usr/lib/ + cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/ + - name: libqvb - Building AppImage using linuxdeployqt + run: | + cd build + wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage + chmod +x ./linuxdeployqt-6-x86_64.AppImage + ./linuxdeployqt-6-x86_64.AppImage --appimage-extract + cd AppDir + ../squashfs-root/AppRun usr/share/applications/qv2ray.desktop -appimage -no-strip -always-overwrite + mv ./Qv2ray*.AppImage ./Qv2ray.AppImage + - name: libqvb - Uploading artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.linux-libqvb.AppImage + path: build/AppDir/Qv2ray.AppImage + - name: libqvb - Upload binaries to release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v1-release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/AppDir/Qv2ray.AppImage + asset_name: Qv2ray-${{ github.ref }}-linux-libqvb.AppImage + tag: ${{ github.ref }} + overwrite: true +# -------------------------------------------------------- cleanup build + - name: cleanup -- clean up build directory to build against legacy gRPC + run: rm -rvf ./build +# -------------------------------------------------------- gRPC build + - name: gRPC - Build Qv2ray + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number PREFIX=/usr + make -j2 + - name: gRPC - Generating filesystem structure for AppImage + run: | + cd build + make install INSTALL_ROOT=AppDir + cd AppDir + mkdir -p ./usr/lib/ + cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/ + - name: gRPC - Building AppImage using linuxdeployqt + run: | + cd build + wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage + chmod +x ./linuxdeployqt-6-x86_64.AppImage + ./linuxdeployqt-6-x86_64.AppImage --appimage-extract + cd AppDir + ../squashfs-root/AppRun usr/share/applications/qv2ray.desktop -appimage -no-strip -always-overwrite + mv ./Qv2ray*.AppImage ./Qv2ray.AppImage + - name: gRPC - Uploading artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.linux-gRPC.AppImage + path: build/AppDir/Qv2ray.AppImage + - name: gRPC - Upload binaries to release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v1-release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/AppDir/Qv2ray.AppImage + asset_name: Qv2ray-${{ github.ref }}-linux.gRPC.AppImage + tag: ${{ github.ref }} + overwrite: true diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml new file mode 100644 index 00000000..39ba5add --- /dev/null +++ b/.github/workflows/Windows.yml @@ -0,0 +1,111 @@ +name: Qv2ray Push Build for Windows + +on: + push: + release: + types: [prereleased] + +jobs: +# ======================================================================================== WINDOWS + Windows: + name: Push build for win64 + runs-on: windows-latest + steps: + - name: Checking out Qv2ray sources + uses: actions/checkout@master + - name: Restoring submodules + run: git submodule update --init +# -------------------------------------------------------- + - name: Installing Qt + uses: jurplel/install-qt-action@v2 + with: + arch: win64_mingw73 + modules: qtcharts +# -------------------------------------------------------- + - name: Extracting gRPC and protobuf libs and headers + run: tools\grpc_gen.bat +# -------------------------------------------------------- + - name: Download libqvb static library. + run: curl -o .\libs\libqvb-win64.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-win64.a +# -------------------------------------------------------- libqvb + - name: libqvb - Building Qv2ray + shell: cmd + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend + mingw32-make -j2 + - name: libqvb - Copying DLLs to build output folders + shell: cmd + run: .github\workflows\copy_DLLs.bat + - name: libqvb - Deploy Qt + shell: cmd + run: | + cd build + cd release + del *.cpp *.h *.o *.qrc *.qm + windeployqt ./qv2ray.exe --compiler-runtime + - name: libqvb - Create 7z Release + uses: DuckSoft/create-7z-action@v1.0 + with: + # file/folder path to compress + pathSource: ./build/release/ + # 7z archive path to write + pathTarget: ./release.7z + - name: libqvb - Uploading artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.Win64-libqvb.7z + path: release.7z + - name: libqvb - Upload binaries to release + uses: svenstaro/upload-release-action@v1-release + if: github.event_name == 'release' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: release.7z + asset_name: Qv2ray-${{ github.ref }}-win64-libqvb.7z + tag: ${{ github.ref }} + overwrite: true +# -------------------------------------------------------- cleanup + - name: cleanup -- clean up build directory to build against legacy gRPC + shell: cmd + run: echo y|rmdir /S build +# -------------------------------------------------------- gRPC + - name: gRPC - Building Qv2ray + shell: cmd + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend + mingw32-make -j2 + - name: gRPC - Copying DLLs to build output folders + shell: cmd + run: .github\workflows\copy_DLLs.bat + - name: gRPC - Deploy Qt + shell: cmd + run: | + cd build + cd release + del *.cpp *.h *.o *.qrc *.qm + windeployqt ./qv2ray.exe --compiler-runtime + - name: gRPC - Create 7z Release + uses: DuckSoft/create-7z-action@v1.0 + with: + # file/folder path to compress + pathSource: ./build/release/ + # 7z archive path to write + pathTarget: ./release.7z + - name: gRPC - Uploading artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.Win64-gRPC.7z + path: release.7z + - name: gRPC - Upload binaries to release + uses: svenstaro/upload-release-action@v1-release + if: github.event_name == 'release' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: release.7z + asset_name: Qv2ray-${{ github.ref }}-win64-gRPC.7z + tag: ${{ github.ref }} + overwrite: true diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml deleted file mode 100644 index bb405602..00000000 --- a/.github/workflows/build-push.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: Qv2ray Push Build - -on: push - -jobs: -# ======================================================================================== WINDOWS - Windows: - name: Push build for win64 - runs-on: windows-latest - steps: - - name: Checking out Qv2ray sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: jurplel/install-qt-action@v2 - with: - arch: win64_mingw73 - modules: qtcharts -# -------------------------------------------------------- - - name: Extracting gRPC and protobuf libs and headers - run: tools\grpc_gen.bat -# -------------------------------------------------------- -# - name: Download libqvb static library. -# run: curl -o .\libs\libqvb-win64.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-win64.a -# -------------------------------------------------------- - - name: Building Qv2ray - shell: cmd - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number - mingw32-make -j2 - - name: Copying DLLs to build output folders - shell: cmd - run: .github\workflows\copy_DLLs.bat - - name: Deploy Qt - shell: cmd - run: | - cd build - cd release - del *.cpp *.h *.o *.qrc *.qm - windeployqt ./qv2ray.exe --compiler-runtime - - name: Create 7z Release - uses: DuckSoft/create-7z-action@v1.0 - with: - # file/folder path to compress - pathSource: ./build/release/ - # 7z archive path to write - pathTarget: ./release.7z - - name: Uploading artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.Win64.7z - path: release.7z - -# ========================================================================================= MACOS - - macOS: - name: Push build for macOS - runs-on: macos-latest - steps: - - name: Checking out sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: jurplel/install-qt-action@v2 - with: - modules: qtcharts -# -------------------------------------------------------- -# - name: Extracting gRPC and protobuf libs and headers -# run: tools/deps_macOS.sh -# -------------------------------------------------------- - - name: Download libqvb static library. - run: curl -o ./libs/libqvb-darwin.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-darwin.a -# -------------------------------------------------------- - - name: Building Qv2ray - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend - make -j2 - - name: Making release tarball - run: | - cd build - cd qv2ray.app - macdeployqt ./ - cd .. - tar czf Qv2ray.app.tar.gz qv2ray.app - - name: Uploading Artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.macOS.app.zip - path: build/Qv2ray.app.tar.gz -# =================================================================================== LINUX - - Linux: - name: Push build for Linux - runs-on: ubuntu-16.04 - steps: - - name: Checking out sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: jurplel/install-qt-action@v2 - with: - modules: qtcharts -# -------------------------------------------------------- - - name: Install Packages - run: | - sudo add-apt-repository ppa:webispy/grpc - sudo add-apt-repository ppa:carsten-uppenbrink-net/openssl - sudo apt update - sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc -# -------------------------------------------------------- -# - name: Extracting gRPC and protobuf libs and headers -# run: tools/grpc_gen.sh -# -------------------------------------------------------- - - name: Download libqvb static library. - uses: Legion2/download-release-action@v2.1.0 - with: - repository: Qv2ray/QvRPCBridge - tag: 'latest' - path: libs - file: libqvb-linux64.a -# -------------------------------------------------------- - - name: Generate Makefile - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend PREFIX=/usr - - name: Building Qv2ray - run: | - cd build - make -j2 - - name: Generating filesystem structure for AppImage - run: | - cd build - make install INSTALL_ROOT=AppDir - cd AppDir - mkdir -p ./usr/lib/ - cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/ - - name: Building AppImage using linuxdeployqt - run: | - cd build - wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage - chmod +x ./linuxdeployqt-6-x86_64.AppImage - ./linuxdeployqt-6-x86_64.AppImage --appimage-extract - cd AppDir - ../squashfs-root/AppRun usr/share/applications/qv2ray.desktop -appimage -no-strip -always-overwrite - mv ./Qv2ray*.AppImage ./Qv2ray.AppImage - - name: Uploading artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.linux.AppImage - path: build/AppDir/Qv2ray.AppImage - diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index f6ad7fc3..00000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,183 +0,0 @@ -name: Build Pre-Release Qv2ray - -on: - release: - types: [prereleased] - -jobs: - Windows: - name: Release for Windows x64 - runs-on: [windows-latest] - steps: - - name: Checking out Qv2ray sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: lhy0403/install-qt-action@v2 - with: - arch: win64_mingw73 - modules: qtcharts -# -------------------------------------------------------- - - name: Extracting gRPC and protobuf libs and headers - run: tools\grpc_gen.bat -# -------------------------------------------------------- -# - name: Download libqvb static library. -# run: curl -o .\libs\libqvb-win64.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-win64.a -# -------------------------------------------------------- - - name: Building Qv2ray - shell: cmd - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number - mingw32-make -j2 - - name: Copying DLLs to build output folders - shell: cmd - run: .github\workflows\copy_DLLs.bat - - name: Make release zipball - shell: cmd - run: | - cd build - cd release - del *.cpp *.h *.o *.qrc *.qm - windeployqt ./qv2ray.exe --compiler-runtime - - name: Create 7z Release - uses: DuckSoft/create-7z-action@v1.0 - with: - pathSource: ./build/release/ - pathTarget: ./release.7z - - name: Uploading artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.Win64.zip - path: build/Qv2ray.zip - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v1-release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/Qv2ray.zip - asset_name: Qv2ray-${{ github.ref }}-win64.zip - tag: ${{ github.ref }} - overwrite: true - -# ========================================================================================= - - macOS: - name: Release for macOS - runs-on: macos-latest - steps: - - name: Checking out sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: lhy0403/install-qt-action@v2 - with: - modules: qtcharts -# -------------------------------------------------------- -# - name: Extracting gRPC and protobuf libs and headers -# run: tools/deps_macOS.sh -# -------------------------------------------------------- - - name: Download libqvb static library. - run: curl -o .\libs\libqvb-darwin.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-darwin.a -# -------------------------------------------------------- - - name: Building Qv2ray - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend - make -j2 - - name: Making release tarball - run: | - cd build - cd qv2ray.app - macdeployqt ./ - cd .. - tar czf Qv2ray.app.tar.gz qv2ray.app - - name: Uploading Artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.macOS.app.zip - path: build/Qv2ray.app.tar.gz - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v1-release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/Qv2ray.app.tar.gz - asset_name: Qv2ray-${{ github.ref }}-macOS.tar.gz - tag: ${{ github.ref }} - overwrite: true -# =================================================================================== - - Linux: - name: Release for linux - runs-on: ubuntu-16.04 - steps: - - name: Checking out sources - uses: actions/checkout@master - - name: Restoring submodules - run: git submodule update --init -# -------------------------------------------------------- - - name: Installing Qt - uses: lhy0403/install-qt-action@v2 - with: - modules: qtcharts -# -------------------------------------------------------- - - name: Install Packages - run: | - sudo add-apt-repository ppa:webispy/grpc - sudo add-apt-repository ppa:carsten-uppenbrink-net/openssl - sudo apt update - sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc -# -------------------------------------------------------- -# - name: Extracting gRPC and protobuf libs and headers -# run: tools/grpc_gen.sh -# -------------------------------------------------------- - - name: Download libqvb static library. - uses: Legion2/download-release-action@v2.1.0 - with: - repository: Qv2ray/QvRPCBridge - tag: 'latest' - path: libs - file: libqvb-linux64.a -# -------------------------------------------------------- - - name: Building Qv2ray - run: | - mkdir build - cd build - qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend PREFIX=/usr - make -j2 - - name: Generating filesystem structure for AppImage - run: | - cd build - make install INSTALL_ROOT=AppDir - cd AppDir - mkdir -p ./usr/lib/ - cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/ - - name: Building AppImage using linuxdeployqt - run: | - cd build - wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage - chmod +x ./linuxdeployqt-6-x86_64.AppImage - ./linuxdeployqt-6-x86_64.AppImage --appimage-extract - cd AppDir - ../squashfs-root/AppRun usr/share/applications/qv2ray.desktop -appimage -no-strip -always-overwrite - mv ./Qv2ray*.AppImage ./Qv2ray.AppImage - - name: Uploading artifact - uses: actions/upload-artifact@master - with: - name: Qv2ray.linux.AppImage - path: build/AppDir/Qv2ray.AppImage - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v1-release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/AppDir/Qv2ray.AppImage - asset_name: Qv2ray-${{ github.ref }}-linux.AppImage - tag: ${{ github.ref }} - overwrite: true - - diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml new file mode 100644 index 00000000..7a2beb85 --- /dev/null +++ b/.github/workflows/macOS.yml @@ -0,0 +1,87 @@ +name: Qv2ray Push Build for macOS + +on: + push: + release: + types: [prereleased] + +jobs: + macOS: + name: Push build for macOS + runs-on: macos-latest + steps: + - name: Checking out sources + uses: actions/checkout@master + - name: Restoring submodules + run: git submodule update --init +# -------------------------------------------------------- + - name: Installing Qt + uses: jurplel/install-qt-action@v2 + with: + modules: qtcharts +# -------------------------------------------------------- + - name: Extracting gRPC and protobuf libs and headers + run: tools/deps_macOS.sh +# -------------------------------------------------------- + - name: Download libqvb static library. + run: curl -o ./libs/libqvb-darwin.a -L https://github.com/Qv2ray/QvRPCBridge/releases/download/v1.0/libqvb-darwin.a +# -------------------------------------------------------- == build against libqvb + - name: libqvb - Build Qv2ray + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number CONFIG+=with_new_backend + make -j2 + - name: libqvb - Making release tarball + run: | + cd build + cd qv2ray.app + macdeployqt ./ + cd .. + tar czf Qv2ray.app.tar.gz qv2ray.app + - name: libqvb - Uploading Artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.macOS.app-libqvb.zip + path: build/Qv2ray.app.tar.gz + - name: libqvb - Upload binaries to release + uses: svenstaro/upload-release-action@v1-release + if: github.event_name == 'release' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/Qv2ray.app.tar.gz + asset_name: Qv2ray-${{ github.ref }}-macOS-libqvb.tar.gz + tag: ${{ github.ref }} + overwrite: true +# -------------------------------------------------------- == cleanup + - name: cleanup -- clean up build directory to build against legacy gRPC + run: rm -rvf ./build +# -------------------------------------------------------- == build against gRPC + - name: gRPC - Build Qv2ray + run: | + mkdir build + cd build + qmake .. CONFIG+=no_increase_build_number + make -j2 + - name: gRPC - Making release tarball + run: | + cd build + cd qv2ray.app + macdeployqt ./ + cd .. + tar czf Qv2ray.app.tar.gz qv2ray.app + - name: gRPC - Uploading Artifact + uses: actions/upload-artifact@master + with: + name: Qv2ray.macOS.app-gRPC.zip + path: build/Qv2ray.app.tar.gz + - name: gRPC - Upload binaries to release + uses: svenstaro/upload-release-action@v1-release + if: github.event_name == 'release' + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/Qv2ray.app.tar.gz + asset_name: Qv2ray-${{ github.ref }}-macOS-gRPC.tar.gz + tag: ${{ github.ref }} + overwrite: true +