Skip to content

Commit e9d1028

Browse files
authored
Merge pull request #32 from xengine-qyt/develop
github actions support
2 parents 9994604 + b4c41c2 commit e9d1028

File tree

9 files changed

+41
-26
lines changed

9 files changed

+41
-26
lines changed

.github/workflows/macbuild.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ jobs:
4141
- name: install library
4242
run: |
4343
brew install lua opencv qrencode
44-
echo "==============opencv4================"
45-
ls -al /opt/homebrew/Cellar/opencv/4.10.0_15/include/opencv4/opencv2
46-
echo "==============tesseract================"
47-
ls -al /opt/homebrew/opt/tesseract/include/tesseract
48-
echo "==============qrencode================"
49-
ls -al /opt/homebrew/opt/qrencode/include
50-
# 设置依赖库的环境变量
44+
5145
- name: Set up Dependency x86_64 Environment
5246
if: matrix.os == 'macos-13'
5347
run: |
@@ -71,7 +65,7 @@ jobs:
7165
sudo mkdir -p /usr/local/lib
7266
sudo cp -rf ./XEngine_Include /usr/local/include
7367
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
74-
#编译
68+
7569
- name: make debug
7670
run: |
7771
cd XEngine_Source

.github/workflows/msbuild.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ jobs:
2121
platform: [x86 ,x64]
2222

2323
runs-on: windows-latest # 最新的 Windows 环境
24-
24+
env:
25+
ACTIONS_STEP_DEBUG: true
2526
steps:
2627
# 检出您的主仓库代码
2728
- name: Checkout main repository code
@@ -65,16 +66,26 @@ jobs:
6566
./vcpkg.exe integrate install
6667
shell: pwsh
6768

68-
# 设置依赖库的环境变量
69-
- name: Set up Dependency Environment Variables
69+
- name: Set up Dependency x86_64 Environment
70+
if: matrix.platform == 'x64'
7071
run: |
7172
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
72-
echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
7373
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
7474
shell: pwsh
75-
76-
- name: Set code page
77-
run: chcp 65001
75+
- name: Set up Dependency x86_32 Environment
76+
if: matrix.platform == 'x86'
77+
run: |
78+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
79+
$latest_tag = $response.tag_name
80+
Write-Host "Latest Tag: $latest_tag"
81+
82+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
83+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
84+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
85+
86+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
87+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
88+
shell: pwsh
7889

7990
# 配置 MSBuild 的路径,准备构建 VC++ 项目
8091
- name: Setup MSBuild
@@ -83,6 +94,7 @@ jobs:
8394
#编译
8495
- name: Build Solution
8596
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
97+
8698
#测试
8799
- name: Conditional Step for x86 Release
88100
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
@@ -92,8 +104,7 @@ jobs:
92104
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
93105
cd XEngine_Release
94106
./VSCopy_x86.bat
95-
./XEngine_APIServiceApp.exe -t
96-
shell: pwsh
107+
./XEngine_HttpApp.exe -t
97108
- name: Conditional Step for x64 Release
98109
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
99110
run: |
@@ -116,4 +127,4 @@ jobs:
116127
uses: actions/upload-artifact@v4
117128
with:
118129
name: XEngine_APIServiceApp-x86_64-Windows
119-
path: XEngine_Release/
130+
path: XEngine_Release/

.github/workflows/ubuntubuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
sudo apt update -y
4747
sudo apt upgrade -y
48-
sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev -y
48+
sudo apt install liblua5.4-dev libopencv-dev libopencv-contrib-dev libqrencode-dev libleptonica-dev libtesseract-dev -y
4949
5050
# 设置依赖库的环境变量
5151
- name: Set up Dependency ubuntu24.04 Environment

XEngine_Source/VSCopy_Debug.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Stream.dll" "./"
1010
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Socket.dll" "./"
1111

1212
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_XSocket.dll" "./"
13+
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIAddr.dll" "./"
14+
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./"
1315
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./"
1416

1517
copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_DataBase.dll" "./"

XEngine_Source/VSCopy_x64.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./"
77

88
copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./"
99
copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Stream.dll" "./"
10-
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./"
10+
copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Socket.dll" "./"
1111

12-
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./"
12+
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./"
13+
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./"
14+
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
1315
copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"
1416

1517
copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./"

XEngine_Source/VSCopy_x86.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Stream.dll" "./"
1010
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./"
1111

1212
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./"
13+
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./"
14+
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
1315
copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"
1416

1517
copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_DataBase.dll" "./"

XEngine_Source/XEngine_ModuleHelp/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ifeq ($(MACRO_QR_SUPPORT),1)
1919
LIB += -lqrencode
2020
endif
2121
ifeq ($(MACRO_OPENCV_SUPPORT),1)
22-
LIB += -llzma -lpng16 -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -ltiff -lopencv_wechat_qrcode -ltesseract
22+
LIB += -llzma -lopencv_core -lopencv_imgcodecs -lopencv_imgproc -lopencv_wechat_qrcode -ltesseract -lleptonica
2323
endif
2424

2525
ifeq ($(RELEASE),1)
@@ -58,8 +58,8 @@ else ifeq ($(PLATFORM),mac)
5858
PLATVER = -D __MACOS__
5959
PLATDIR = XEngine_Mac
6060
FILEEXT = dylib
61-
LOADHDR += -I /opt/homebrew/opt/opencv/include/opencv4 -I /opt/homebrew/opt/tesseract/include -I /opt/homebrew/opt/qrencode/include -I /opt/homebrew/opt/lua/include
62-
LOADSO += -L /opt/homebrew/opt/opencv/lib -L /opt/homebrew/opt/tesseract/lib -L /opt/homebrew/opt/qrencode/lib -L /opt/homebrew/opt/lua/lib
61+
LOADHDR += -I /opt/homebrew/opt/leptonica/include -I /opt/homebrew/opt/opencv/include/opencv4 -I /opt/homebrew/opt/tesseract/include -I /opt/homebrew/opt/qrencode/include
62+
LOADSO += -L /opt/homebrew/opt/leptonica/lib -L /opt/homebrew/opt/opencv/lib -L /opt/homebrew/opt/tesseract/lib -L /opt/homebrew/opt/qrencode/lib
6363
LIBFLAG = -dynamiclib
6464
LIBEX = -lpthread -ldl
6565
LOADBIN = -Wl,-rpath,@loader_path/./

XEngine_Source/XEngine_ModuleHelp/pch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include <opencv4/opencv2/opencv.hpp>
3131
#include <opencv4/opencv2/core/utils/logger.hpp>
3232
#include <opencv4/opencv2/wechat_qrcode.hpp>
33-
#include <leptonica/allheaders.h>
34-
#include <tesseract/capi.h>
3533
#else
3634
#include <opencv2/opencv.hpp>
3735
#include <opencv2/core/utils/logger.hpp>
@@ -41,6 +39,8 @@
4139
#include <opencv2/wechat_qrcode.hpp>
4240
#include <sys/socket.h>
4341
#endif
42+
#include <leptonica/allheaders.h>
43+
#include <tesseract/capi.h>
4444
#include <qrencode.h>
4545
#endif
4646
using namespace std;

XEngine_Source/XEngine_ModulePlugin/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ else ifeq ($(PLATFORM),mac)
5454
PLATDIR = XEngine_Mac
5555
FILEEXT = dylib
5656
LIBFLAG = -dynamiclib
57+
58+
LOADHDR += -I /opt/homebrew/opt/lua/include/lua
59+
LOADSO += -L /opt/homebrew/opt/lua/lib
60+
5761
ifeq ($(MACRO_LUA_SUPPORT),1)
5862
LIB += -llua
5963
endif

0 commit comments

Comments
 (0)